Changeset 6060


Ignore:
Timestamp:
Jun 5, 2008, 8:41:32 PM (13 years ago)
Author:
charles
Message:

(gtk) #998: gtk client crashes if you quit while the stats window is still up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/stats.c

    r5908 r6060  
    7878
    7979static void
     80dialogDestroyed( gpointer p, GObject * dialog UNUSED )
     81{
     82    g_source_remove( GPOINTER_TO_UINT( p ) );
     83}
     84
     85static void
    8086dialogResponse( GtkDialog * dialog, gint response, gpointer gdata )
    8187{
     
    9197    if( response == GTK_RESPONSE_CLOSE )
    9298    {
    93         g_source_remove( GPOINTER_TO_UINT( g_object_get_data( G_OBJECT(dialog), "TrTimer" ) ) );
    9499        gtk_widget_destroy( GTK_WIDGET( dialog ) );
    95100    }
     
    144149    g_signal_connect( d, "response", G_CALLBACK(dialogResponse), ui );
    145150    i = g_timeout_add( 1000, updateStats, ui );
    146     g_object_set_data( G_OBJECT(d), "TrTimer", GUINT_TO_POINTER(i) );
     151    g_object_weak_ref( G_OBJECT( d ), dialogDestroyed, GUINT_TO_POINTER( i ) );
    147152    return d;
    148153}
Note: See TracChangeset for help on using the changeset viewer.