Revision: 28747
http://sourceforge.net/p/bibdesk/svn/28747
Author: hofman
Date: 2024-02-16 17:28:31 +0000 (Fri, 16 Feb 2024)
Log Message:
-----------
terminate texTask for item pasteboard helperwhen delegate is nil, dealloc may
not be called to terminate it when the app terminates
Modified Paths:
--------------
trunk/bibdesk/BDSKItemPasteboardHelper.m
Modified: trunk/bibdesk/BDSKItemPasteboardHelper.m
===================================================================
--- trunk/bibdesk/BDSKItemPasteboardHelper.m 2024-02-16 17:02:22 UTC (rev
28746)
+++ trunk/bibdesk/BDSKItemPasteboardHelper.m 2024-02-16 17:28:31 UTC (rev
28747)
@@ -99,6 +99,10 @@
}];
}
delegate = newDelegate;
+ if (delegate == nil && texTask) {
+ [texTask terminate];
+ texTask = nil;
+ }
}
}
@@ -288,10 +292,14 @@
} else {
BDSKTeXTask *currentTask = [texTasks objectForKey:pbName];
if (currentTask) {
- if (currentTask == texTask)
+ if (currentTask != texTask) {
+ [currentTask terminate];
+ } else if (delegate) {
[currentTask cancel];
- else
+ } else {
[currentTask terminate];
+ texTask = nil;
+ }
[texTasks removeObjectForKey:pbName];
}
[dict removeObjectForKey:TEXTASKRESULT_KEY];
@@ -309,10 +317,14 @@
NSString *pbName = [pboard name];
BDSKTeXTask *currentTask = [texTasks objectForKey:pbName];
if (currentTask) {
- if (currentTask == texTask)
+ if (currentTask != texTask) {
+ [currentTask terminate];
+ } else if (delegate) {
[currentTask cancel];
- else
+ } else {
[currentTask terminate];
+ texTask = nil;
+ }
[texTasks removeObjectForKey:pbName];
}
[promisedPboardTypes removeObjectForKey:pbName];
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