From d686257320be87139203b1537686cd32d91cc67d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 14 Dec 2009 18:20:11 +0000 Subject: [PATCH] (trunk gtk) #2500 "Torrent details window should be single-instance per torrent" -- fix implementation bug from r9685 that caused the same memory to be freed twice on shutdown --- gtk/main.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/gtk/main.c b/gtk/main.c index 829436196..f50a39602 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -781,18 +781,9 @@ onSessionClosed( gpointer gdata ) struct cbdata * cbdata = gdata; /* shutdown the gui */ - if( cbdata->details != NULL ) - { - GSList * l; - for( l=cbdata->details; l!=NULL; l=l->next ) - { - struct DetailsDialogHandle * h = l->data; - gtk_widget_destroy( h->dialog ); - g_free( h->key ); - g_free( h ); - } - g_slist_free( cbdata->details ); - cbdata->details = NULL; + while( cbdata->details != NULL ) { + struct DetailsDialogHandle * h = cbdata->details->data; + gtk_widget_destroy( h->dialog ); } if( cbdata->prefs ) -- 2.40.0