FLTK logo

STR #3238

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | SVN ⇄ GIT ]

STR #3238

Application:FLTK Library
Status:2 - Closed w/o Resolution
Priority:3 - Moderate, e.g. unable to compile the software
Scope:3 - Applies to all machines and operating systems
Subsystem:Core Library
Summary:Fl_Group::clear method should be virtual
Version:1.4-feature
Created By:mingodad
Assigned To:AlbrechtS
Fix Version:Will Not Fix
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 mingodad
07:56 Jul 04, 2015
When any derived class form Fl_Group are used through a cast to Fl_Group pointer and calling the Fl_Group::clear method we get:

*** Error in `anyfltk-app': free(): invalid pointer: 0x0000000000bd9ce8 ***

The above error was caught when a Fl_Scroll was casted to Fl_Group and calling the clear method.

Probably there are other methods that are also override by derived classes of Fl_Group.

Cheers !
 
 
#2 AlbrechtS
02:43 Jul 07, 2015
Thanks for the report.

Unfortunately we can't make any methods virtual w/o breaking the ABI.

There are many more methods, particularly of Fl_Group, that should be virtual. This will be addressed in the next minor release of FLTK (1.4.0).
 
 
#3 AlbrechtS
13:47 Aug 04, 2015
Moved from 1.3-feature to 1.4-feature.  
 
#4 AlbrechtS
16:18 Nov 09, 2016
Changed priority from 1 (RFE) to 4 (High) since this must be included in FLTK 1.4.0, together with several other methods that should be virtual, although this is formally a RFE.  
 
#5 AlbrechtS
06:07 Dec 05, 2021
Unfortunately this issue can't be resolved easily (or maybe not at all) by making some of the methods of Fl_Group virtual. These methods can't be made virtual because:

(a) many overloaded methods with the same names but different semantics exist in derived classes in the FLTK core

(b) we can't change these methods because user code may have used and overridden them in their own derived classes.

I've been thinking about adding some new methods with other names to achieve some of the desirable goals but this is not a trivial design change. :-(

Methods that can't be made virtual include [Fl_Group::] clear, remove, add, insert, ...
 
 
#6 AlbrechtS
07:11 Dec 05, 2021
Changed priority from 4 (High) to 3 (Moderate) because we can't do this in FLTK 1.4.0 as such.

I'm leaving this STR open as a reminder but there's no guarantee that this particular issue can be addressed in the near future.
 
 
#7 AlbrechtS
05:03 Nov 17, 2023
I'm closing this STR now because we can't make these methods virtual.

There may be another solution in FLTK 1.4 or 1.5 that uses different method names but this is not yet decided.
 
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.