Revision: 28661
http://sourceforge.net/p/bibdesk/svn/28661
Author: hofman
Date: 2024-01-23 22:50:35 +0000 (Tue, 23 Jan 2024)
Log Message:
-----------
use dispatch for main thread
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m 2024-01-23
22:33:36 UTC (rev 28660)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m 2024-01-23
22:50:35 UTC (rev 28661)
@@ -186,7 +186,9 @@
{
// typically on the main thread here, but not guaranteed; can never be
called during a load anyway
if (pthread_main_np() == 0) {
- [self performSelectorOnMainThread:@selector(_releaseWebView)
withObject:nil waitUntilDone:YES modes:[NSArray
arrayWithObject:(id)kCFRunLoopCommonModes]];
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ [self _releaseWebView];
+ });
}
else {
// make sure to deregister for notification
@@ -212,8 +214,9 @@
If webview is non-nil, we need to cancel the load.
If webview is nil, we need to unregister for the notification.
*/
- [self performSelectorOnMainThread:@selector(_releaseWebView)
withObject:nil waitUntilDone:YES modes:[NSArray
arrayWithObject:(id)kCFRunLoopCommonModes]];
-
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ [self _releaseWebView];
+ });
// need to avoid creating the fallback icon in this case, so we know
to retry later
_webLoader = nil;
[_condLock unlockWithCondition:LOADED];
@@ -355,7 +358,9 @@
// make sure needsRenderForSize: knows that we're actively rendering,
so renderForSize: doesn't get called again
[_condLock unlockWithCondition:LOADING];
- [self performSelectorOnMainThread:@selector(_startWebView)
withObject:nil waitUntilDone:NO modes:[NSArray
arrayWithObject:(id)kCFRunLoopCommonModes]];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self _startWebView];
+ });
[_condLock lockWhenCondition:LOADED];
CGImageRef fullImage = NULL, thumbnail = NULL;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit