fix double free in disk cache
This commit is contained in:
parent
f86e207ba2
commit
2d6268b580
|
@ -1,3 +1,4 @@
|
|||
* fix double free in disk cache
|
||||
* forward declaring libtorrent types is discouraged. a new fwd.hpp header is provided
|
||||
|
||||
1.1.3 release
|
||||
|
|
|
@ -757,13 +757,13 @@ namespace libtorrent
|
|||
--pe->piece_refcount;
|
||||
iovec_flushed(pe, flushing, iov_len, 0, error, completed_jobs);
|
||||
|
||||
m_disk_cache.maybe_free_piece(pe);
|
||||
|
||||
// if the cache is under high pressure, we need to evict
|
||||
// the blocks we just flushed to make room for more write pieces
|
||||
int evict = m_disk_cache.num_to_evict(0);
|
||||
if (evict > 0) m_disk_cache.try_evict_blocks(evict);
|
||||
|
||||
m_disk_cache.maybe_free_piece(pe);
|
||||
|
||||
return iov_len;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue