MacArthur, Ian (SELEX GALILEO, UK) wrote: >> This is exactly why mike suggested to implement release() in >> the Fl_Image class I think. >> This way, we could avoid completely the need of deleting images. >> a release base impl. would just delete himself in the non >> shared image impl., >> the shared image would do what it does now. > > Implementing "release" in the base-class would at least make it > consistent. > > Then what we tell/educate users is "always release an image object, > never call delete on it" and things will work for all classes. > > Is that right?
Right. Also, FWIW we could do the same thing for widgets - then when we do a callback we can retain the widget before doing the callback, and then release afterwords (to effectively delete the widget after we're done referencing it...) This is how Cocoa and ObjC have done things for years, although now Cocoa/ObjC also support lazy programming with garbage collection too. -- ______________________________________________________________________ Michael Sweet, Easy Software Products mike at easysw dot com _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
