From a1805875eecee06d5d17843e107da5ec0642639b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 16 Nov 2007 20:41:41 +0000 Subject: [PATCH] try to fix the platform.c:278 issue reported by dave in http://transmission.m0k.org/forum/viewtopic.php?t=2949 --- libtransmission/torrent.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 08b2d532d..2e609160a 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1046,6 +1046,16 @@ tr_torrentStart( tr_torrent * tor ) tr_globalUnlock( tor->handle ); } +static void +torrentRecheckDoneImpl( void * vtor ) +{ + tr_torrentRecheckCompleteness( vtor ); +} +static void +torrentRecheckDoneCB( tr_torrent * tor ) +{ + tr_runInEventThread( tor->handle, torrentRecheckDoneImpl, tor ); +} void tr_torrentRecheck( tr_torrent * tor ) { @@ -1055,7 +1065,7 @@ tr_torrentRecheck( tr_torrent * tor ) tor->uncheckedPieces = tr_bitfieldNew( tor->info.pieceCount ); tr_bitfieldAddRange( tor->uncheckedPieces, 0, tor->info.pieceCount ); - tr_ioRecheckAdd( tor, tr_torrentRecheckCompleteness ); + tr_ioRecheckAdd( tor, torrentRecheckDoneCB ); tr_globalUnlock( tor->handle ); }