]> granicus.if.org Git - transmission/commitdiff
(libT) ensure that tr_torrentVerify()'s completion callback gets invoked even if...
authorJordan Lee <jordan@transmissionbt.com>
Fri, 1 Feb 2013 00:21:30 +0000 (00:21 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Fri, 1 Feb 2013 00:21:30 +0000 (00:21 +0000)
libtransmission/verify.c

index b79e223f2710f9c41e5bab7277eaf17bc5c65e1d..c27cba158c9167328c5438c4ac44183473e90f77 100644 (file)
@@ -309,8 +309,17 @@ tr_verifyRemove (tr_torrent * tor)
     }
   else
     {
-      tr_free (tr_list_remove (&verifyList, tor, compareVerifyByTorrent));
+      struct verify_node * node = tr_list_remove (&verifyList, tor, compareVerifyByTorrent);
+
       tr_torrentSetVerifyState (tor, TR_VERIFY_NONE);
+
+      if (node != NULL)
+        {
+          if (node->callback_func != NULL)
+            (*node->callback_func)(tor, true, node->callback_data);
+
+          tr_free (node);
+        }
     }
 
   tr_lockUnlock (lock);