mirror of
https://github.com/transmission/transmission
synced 2024-12-26 17:47:37 +00:00
fix another pair of #5168 oopses (oopsii?)
This commit is contained in:
parent
399c3233b7
commit
e2f1d6744e
1 changed files with 9 additions and 1 deletions
|
@ -173,6 +173,8 @@ tr_torrentIsPieceTransferAllowed (tr_torrent * tor,
|
|||
if (tr_sessionGetActiveSpeedLimit_Bps (tor->session, direction, &limit))
|
||||
if (limit <= 0)
|
||||
allowed = false;
|
||||
|
||||
tr_torrentUnref (tor);
|
||||
}
|
||||
|
||||
return allowed;
|
||||
|
@ -1876,7 +1878,11 @@ tr_torrentUnref (tr_torrent * tor)
|
|||
{
|
||||
assert (tr_isTorrent (tor));
|
||||
|
||||
if (--tor->refCount == 0)
|
||||
if (tor->refCount > 1)
|
||||
{
|
||||
--tor->refCount;
|
||||
}
|
||||
else if (tor->refCount == 1)
|
||||
{
|
||||
tr_session * session = tor->session;
|
||||
|
||||
|
@ -1884,6 +1890,8 @@ tr_torrentUnref (tr_torrent * tor)
|
|||
tr_torrentClearCompletenessCallback (tor);
|
||||
tr_runInEventThread (session, closeTorrent, tor);
|
||||
tr_sessionUnlock (session);
|
||||
|
||||
--tor->refCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue