Revision: 28976
          http://sourceforge.net/p/bibdesk/svn/28976
Author:   hofman
Date:     2024-11-25 17:01:50 +0000 (Mon, 25 Nov 2024)
Log Message:
-----------
Assign block to variables together after declaring the variables. This makes 
sure they are properly assigned, and also implicitly assures the block to be 
copied to the heap as I read the docs.

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

Modified: trunk/bibdesk/BDSKFiler.m
===================================================================
--- trunk/bibdesk/BDSKFiler.m   2024-11-18 09:54:04 UTC (rev 28975)
+++ trunk/bibdesk/BDSKFiler.m   2024-11-25 17:01:50 UTC (rev 28976)
@@ -175,7 +175,9 @@
        }
        
     __weak __block void (^weakFilePaperInfo)(NSInteger);
-    __block void (^filePaperInfo)(NSInteger) = [^(NSInteger i){
+    __block void (^filePaperInfo)(NSInteger);
+    
+    weakFilePaperInfo = filePaperInfo = ^(NSInteger i){
         
         if (i < numberOfPapers) {
             // file the i'th paper
@@ -332,8 +334,7 @@
             // this balances the copy, avoids a retain cycle
             weakFilePaperInfo = nil;
         }
-    } copy];
-    weakFilePaperInfo = filePaperInfo;
+    };
     
     // file the first paper, this will recursively call the next one
     filePaperInfo(0);

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