Improve locking around clearContents (#1107)

* Improve locking around clearContents

* Add changelog
This commit is contained in:
Michael Schneider
2018-09-14 08:48:19 -07:00
committed by GitHub
parent eb5bd0942b
commit f759d5cc7d
5 changed files with 21 additions and 9 deletions

View File

@@ -590,10 +590,9 @@ static ASDN::StaticMutex& cacheLock = *new ASDN::StaticMutex;
- (void)clearContents
{
[super clearContents];
__instanceLock__.lock();
_weakCacheEntry = nil; // release contents from the cache.
__instanceLock__.unlock();
ASDN::MutexLocker l(__instanceLock__);
_weakCacheEntry = nil; // release contents from the cache.
}
#pragma mark - Cropping