From 5c3d45767e5cfe78bee0724e3a3711112a8d430c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 16 Aug 2007 20:59:09 +0000 Subject: [PATCH] fix crash-on-startup bug reported by Lacrocivious --- libtransmission/tracker.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libtransmission/tracker.c b/libtransmission/tracker.c index ae1c146f7..7322cbf78 100644 --- a/libtransmission/tracker.c +++ b/libtransmission/tracker.c @@ -605,7 +605,14 @@ onTrackerScrapeNow( void * vt ) { Tracker * t = (Tracker*) vt; - assert( tr_ptrArrayEmpty( t->scraping ) ); + if( !tr_ptrArrayEmpty( t->scraping ) ) + { + /* there's already a scrape going for this tracker... + we only one one at a time, so don't do anything yet. + when the current scrape is done, onScrapeResponse() + will call us again. */ + return FALSE; + } if( !tr_ptrArrayEmpty( t->scrapeQueue ) ) {