Re: [UFO-devel] BoUfo widget deleter
Status: Beta
Brought to you by:
schmidtjf
From: Johannes S. <sch...@us...> - 2005-12-02 07:23:11
|
Am Mittwoch 30 November 2005 23:52 schrieb Andreas Beckermann: > Hi > the attached patch is pretty controversial, but I decided to give it a try > anyway. > > In Boson we cannot use libufo directly, due to > a) conflicting toolkits > b) different APIs Well, as may best please you. > Therefore I have written a BoUfo library that provides the required widgets > in wrapper classes. However this solution has one major problem: > destruction. A statement such as > ufoWidget->removeAll(); > would delete all ufo widgets, however not the corresponding wrapper > objects. Therefore I have patched our libufo copy to introduce a "widget > deleter". This is simply an object that is deleted at the beginning of the > ufo::UWidget d'tor. Any class deriving from this class can do cleanup tasks > that may be necessary before the widget actually is deleted. > > A normal ufo::UObject that is added to the widget using trackPointer() is > _not_ sufficient, as this is deleted by the ufo::UObject d'tor only and at > this point the ufo::UWidget has already been destroyed. Just a quick question: Where do you actually use the UWidget pointer in your BoUfoWidget d'tor? If haven't found any direct access to the UWidget object here: http://cvs.sourceforge.net/viewcvs.py/boson/code/boson/boufo/boufowidget.cpp?rev=1.9&view=markup Regards, Johannes |