Bug in gnome_dialog_set_parent



In GnomeHack, I've encountered the following bug.  It seems that
gnome_dialog_set_parent is a one shot.  Using this function a second
time on an already realised widget seems to produce the following crash:

    Gtk-WARNING **: invalid cast from (NULL) pointer to `GtkObject'

    Program received signal SIGSEGV, Segmentation fault.
    0x40224c8c in gtk_window_set_transient_for ()
    (gdb) bt
    #0  0x40224c8c in gtk_window_set_transient_for ()
    #1  0x4038f686 in gnome_dialog_set_parent ()
    #2  0x816c2aa in ghack_menu_window_display (menuWin=0x83384d8, blocking=0, 
	data=0x0) at GnomeHackMenuWindow.c:165

I have found that doing the following prevents the cash, and makes 
everything work as expected:

    if (! GTK_WIDGET_REALIZED (GTK_WIDGET(menuWin))) {
         gnome_dialog_set_parent (GNOME_DIALOG (menuWin), GTK_WINDOW (window));
    }

I just thought some other folks might want to know.

[andersen@dillweed andersen]$ glib-config --version
1.2.2
[andersen@dillweed andersen]$ gtk-config --version
1.2.2
[andersen@dillweed andersen]$ gnome-config --version
gnome-libs 1.0.9

 -Erik

--
Erik B. Andersen   Web:    http://www.xmission.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--



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