Revision: 28607
          http://sourceforge.net/p/bibdesk/svn/28607
Author:   hofman
Date:     2024-01-15 00:09:39 +0000 (Mon, 15 Jan 2024)
Log Message:
-----------
call callback directly instead of using NSInvocation

Modified Paths:
--------------
    trunk/bibdesk/BDSKTemplateDocument.m

Modified: trunk/bibdesk/BDSKTemplateDocument.m
===================================================================
--- trunk/bibdesk/BDSKTemplateDocument.m        2024-01-15 00:05:58 UTC (rev 
28606)
+++ trunk/bibdesk/BDSKTemplateDocument.m        2024-01-15 00:09:39 UTC (rev 
28607)
@@ -972,13 +972,9 @@
             [super canCloseDocumentWithDelegate:delegate 
shouldCloseSelector:shouldCloseSelector contextInfo:contextInfo];
         }
     } else if (delegate && shouldCloseSelector) {
-        NSInvocation *invocation = [NSInvocation invocationWithTarget:delegate 
selector:shouldCloseSelector];
-        BOOL no = NO;
-        __unsafe_unretained id unretainedSelf = self;
-        [invocation setArgument:&unretainedSelf atIndex:2];
-        [invocation setArgument:&no atIndex:3];
-        [invocation setArgument:&contextInfo atIndex:4];
-        [invocation invoke]; 
+        void (*shouldCloseImp)(id, SEL, id, BOOL, void *) = (void (*)(id, SEL, 
id, BOOL, void *))[delegate methodForSelector:shouldCloseSelector];
+        if (shouldCloseImp)
+            shouldCloseImp(delegate, shouldCloseSelector, self, NO, 
contextInfo);
     }
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to