Fred Kiefer wrote:

I just had a look at the only other place where we try to handle
graphics calls from a secondary thread, NSAlert, and the code there
looks wrong to me. Could somebody else please give a second opinion
before I start to clean that up?

I guess you mean the implementation of
-beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:.
Yes, this is outright broken.

The other point I noticed is the unusual memory handling of the
private _GSAlertPanelCreation class w.r.t its panel attribute.
This attribute is initialized in the -makePanel method but not
released in -dealloc, which in principle means asking for a
space leak. A more idiomatic solution would be to release the
panel in _GSAlertPanelCreation's -dealloc method and retain the
panel in the private getSomePanel function (which is the only
place where _GSAlertPanelCreation is used). And probably it
would be a good idea to use _GSAlertPanelCreation also when
getSomePanel is called on the main thread (if only to ensure
that any future fixes or changes to this code will apply to
the main thread as well as to secondary threads).

Wolfgang



_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to