From 61263c844e13badb9963e4f32d033c4f3fc5af3b Mon Sep 17 00:00:00 2001 From: Josh Elsasser Date: Wed, 23 May 2007 04:38:35 +0000 Subject: [PATCH] Fix deleting a torrent which has a properties window open. (this should be merged if there is ever a 0.73) --- gtk/dialogs.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gtk/dialogs.c b/gtk/dialogs.c index ce4c51a26..a06d2baa0 100644 --- a/gtk/dialogs.c +++ b/gtk/dialogs.c @@ -707,20 +707,28 @@ infowinddead( GtkWidget * widget SHUTUP, gpointer data ) { struct infowind * iw = data; - g_object_weak_unref( G_OBJECT( iw->tor ), infotorclosed, iw ); - infotorclosed( iw, G_OBJECT( iw->tor ) ); + if( NULL != iw->widget ) + { + g_object_weak_unref( G_OBJECT( iw->tor ), infotorclosed, iw ); + infotorclosed( iw, G_OBJECT( iw->tor ) ); + } } static void infotorclosed( gpointer data, GObject * tor SHUTUP ) { struct infowind * iw = data; + GtkWidget * widget; + + /* neuter the widget's destroy callback */ + widget = iw->widget; + iw->widget = NULL; g_source_remove( iw->timer ); g_object_unref( iw->filesmodel ); g_object_unref( iw->model ); gtk_tree_row_reference_free( iw->row ); - gtk_widget_destroy( iw->widget ); + gtk_widget_destroy( widget ); g_free( iw ); }