Changeset 6179


Ignore:
Timestamp:
Jun 13, 2008, 9:00:00 PM (13 years ago)
Author:
charles
Message:

(1.2x gtk) backport the fix to the #998 crasher

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2x/gtk/stats.c

    r5666 r6179  
    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.