From 0f91ee9c28c59b7350e26737344736af1d83a97b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 15 Jun 2009 20:29:26 +0000 Subject: [PATCH] (trunk gtk) fix another crash in Properties > Options, reported by elgeneralmidi w/a valgrind log --- gtk/tr-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/tr-core.c b/gtk/tr-core.c index 0a2f0025c..5b72152fb 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -1353,7 +1353,7 @@ readResponseIdle( void * vresponse ) tag = (int)intVal; data = g_hash_table_lookup( pendingRequests, &tag ); - if( data ) + if( data && data->responseFunc ) (*data->responseFunc)(data->core, &top, data->responseFuncUserData ); tr_bencFree( &top ); @@ -1469,7 +1469,8 @@ tr_core_blocklist_update( TrCore * core ) void tr_core_exec_json( TrCore * core, const char * json ) { - sendRequest( core, json, 0, NULL, NULL ); + const int tag = nextTag++; + sendRequest( core, json, tag, NULL, NULL ); } void