Revision: 13115
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=13115&view=rev
Author: amaxwell
Date: 2008-04-03 12:54:33 -0700 (Thu, 03 Apr 2008)
Log Message:
-----------
Fix deadlock.
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m 2008-04-03
05:45:31 UTC (rev 13114)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m 2008-04-03
19:54:33 UTC (rev 13115)
@@ -455,16 +455,23 @@
if (NULL == _thumbnail)
_thumbnail = [FVIconCache newThumbnailNamed:_diskCacheName];
+ // unlock before calling performSelectorOnMainThread:... since it could
cause a callout that tries to acquire the lock (one of the delegate methods)
+
if (NULL == _thumbnail && NULL == _fullImage && NO == _webviewFailed && NO
== _isRendering) {
// make sure needsRenderForSize: knows that we're actively rendering,
so renderOffscreen doesn't get called again
_isRendering = YES;
+ [self unlock];
[self
performSelectorOnMainThread:@selector(renderOffscreenOnMainThread)
withObject:nil waitUntilDone:YES modes:_commonModes];
}
else if (YES == _webviewFailed && nil == _fallbackIcon) {
_fallbackIcon = [[FVFinderIcon allocWithZone:[self zone]]
initWithFinderIconOfURL:_httpURL];
+ [self unlock];
}
- [_fallbackIcon renderOffscreen];
- [self unlock];
+ else {
+ // no condition on this branch; we always unlock
+ [_fallbackIcon renderOffscreen];
+ [self unlock];
+ }
}
- (void)fastDrawInRect:(NSRect)dstRect ofContext:(CGContextRef)context;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit