gnome_dialog_set_parent seg fault



In GnomeHack, I have begun seeing a bunch of seg faults related
to gnome_dialog_set_parent:

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

Program received signal SIGSEGV, Segmentation fault.
0x402245cc in gtk_window_set_transient_for () from /usr/lib/libgtk-1.2.so.0
(gdb) bt
#0  0x402245cc in gtk_window_set_transient_for () from /usr/lib/libgtk-1.2.so.0
#1  0x40389f76 in gnome_dialog_set_parent () from /usr/lib/libgnomeui.so.32
#2  0x816c95f in ghack_menu_window_display (menuWin=0x83aca08, blocking=0, 
    data=0x0) at GnomeHackMenuWindow.c:168

I'm quite puzzled as to what could be going on here. I think I'm
checking for most everything here -- if it was the parameters I
am passing in, I would expect the g_asserts I have included to be
triggered: Anybody have any idea why this is crashing, and what I can do
about it (other than removing the gnome_dialog_set_parent() call?

void
ghack_menu_window_display(GtkWidget *menuWin, gboolean blocking,
                          gpointer *data)
{
    /* Center the dialog over parent */
    GtkWidget *parent = ghack_get_main_window ();
    g_assert (parent != NULL);
    g_assert (menuWin != NULL);
    g_assert (GTK_IS_WINDOW (parent));
    g_assert (GNOME_IS_DIALOG (menuWin));
    gnome_dialog_set_parent (GNOME_DIALOG (menuWin), GTK_WINDOW (parent));

    /* FIXME: select_menu is really where window display should occur */
    if(blocking)
        gnome_dialog_run_and_close (GNOME_DIALOG (menuWin));
    else
        gtk_widget_show(menuWin);
}

 -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]