Revision: 24127
          http://sourceforge.net/p/bibdesk/svn/24127
Author:   hofman
Date:     2019-08-12 14:03:15 +0000 (Mon, 12 Aug 2019)
Log Message:
-----------
macro to destroy a block

Modified Paths:
--------------
    trunk/bibdesk/BDSKSearchGroup.m
    trunk/bibdesk/Bibdesk_Prefix.pch
    trunk/bibdesk/NSColor_BDSKExtensions.m

Modified: trunk/bibdesk/BDSKSearchGroup.m
===================================================================
--- trunk/bibdesk/BDSKSearchGroup.m     2019-08-12 13:55:18 UTC (rev 24126)
+++ trunk/bibdesk/BDSKSearchGroup.m     2019-08-12 14:03:15 UTC (rev 24127)
@@ -531,11 +531,7 @@
     importFinished = YES;
     [server terminate];
     BDSKDESTROY(server);
-    if (completionHandler) {
-        completionHandler(publications);
-        Block_release(completionHandler);
-        completionHandler = NULL;
-    }
+    BDSKBLOCKDESTROY(completionHandler);
     [self release];
 }
 

Modified: trunk/bibdesk/Bibdesk_Prefix.pch
===================================================================
--- trunk/bibdesk/Bibdesk_Prefix.pch    2019-08-12 13:55:18 UTC (rev 24126)
+++ trunk/bibdesk/Bibdesk_Prefix.pch    2019-08-12 14:03:15 UTC (rev 24127)
@@ -81,6 +81,7 @@
     #define BDSKCFDESTROY(variable) do { if (variable) CFRelease(variable); 
variable = NULL; } while (0)
     #define BDSKZONEDESTROY(variable) do { if (variable) 
NSZoneFree(NSZoneFromPointer((void *)variable), (void *)variable); variable = 
NULL; } while (0)
     #define BDSKDISPATCHDESTROY(variable) do { if (variable) 
dispatch_release(variable); variable = NULL; } while (0)
+    #define BDSKBLOCKDESTROY(variable) do { if (variable) 
Block_release(variable); variable = NULL; } while (0)
 
     // see e.g. 
http://www.mulle-kybernetik.com/artikel/Optimization/opti-7.html, perhaps this 
could be improved on 64-bits
     #define BDSKHash(self) (((NSUInteger) self >> 4) | ((NSUInteger) self << 
(32 - 4)))

Modified: trunk/bibdesk/NSColor_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSColor_BDSKExtensions.m      2019-08-12 13:55:18 UTC (rev 
24126)
+++ trunk/bibdesk/NSColor_BDSKExtensions.m      2019-08-12 14:03:15 UTC (rev 
24127)
@@ -498,10 +498,7 @@
 }
 
 - (void)dealloc {
-    if (colorGenerator) {
-        Block_release(colorGenerator);
-        colorGenerator = NULL;
-    }
+    BDSKBLOCKDESTROY(colorGenerator);
     [super dealloc];
 }
 

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

Reply via email to