finalization issues (?)



I have my own GObject called SeahorseWidget, which contains a GladeXML,
plus some extra data.  I've hooked up the finalize function to free the
xml, then sets the xml to null.  To create a new dialog, I create a new
SeahorseWidget, which connect generic signals, such as when the cancel
button is pressed.  When the 'closed' signal calls g_object_unref on the
SeahorseWidget, which then causes finalize to be called.
The problem is that some dialogs can only have one instance at a time. 
I keep a static SeahorseWidget pointer in the dialog's source file.  To
check if an instance already exists, I check if the pointer is null, or
if pointer->xml is null.  If this does not fail, the I call
gtk_window_present(glade_xml_get_widget (swidget->xml, swidget->name)),
which gets the main window.  Unfortunately, the instance test does not
always fail when it should and I get segfaults from
glade_xml_get_widget.
Can anyone help out?  For more info, look at
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/seahorse/seahorse2/src/seahorse-widget.c

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/seahorse/seahorse2/src/dialogs/seahorse-generate.c


Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]