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 | Post Text | Post File ]

STR #3238

Application:FLTK Library
Status:5 - New
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:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]

No files


Trouble Report Comments:

Post Text ]
Name/Time/Date Text top right image
 
#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.
 
bottom left image   bottom right image

Return to Bugs & Features | Post Text | Post File ]

 
 

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