Revision: 4139
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4139&view=rev
Author:   hofman
Date:     2008-07-06 14:30:58 -0700 (Sun, 06 Jul 2008)

Log Message:
-----------
Small reorganization of method swizzling in framework

Modified Paths:
--------------
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.m

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2008-07-06 17:21:35 UTC 
(rev 4138)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2008-07-06 21:30:58 UTC 
(rev 4139)
@@ -95,16 +95,13 @@
 }
 
 + (void)load {
+    Method aMethod = class_getInstanceMethod(self, @selector(dealloc));
+    Method impMethod = class_getInstanceMethod(self, 
@selector(replacementDealloc));
     if (method_getImplementation != NULL && method_setImplementation != NULL) {
-        originalDealloc = 
method_setImplementation(class_getInstanceMethod(self, @selector(dealloc)), 
method_getImplementation(class_getInstanceMethod(self, 
@selector(replacementDealloc))));
+        originalDealloc = method_setImplementation(aMethod, 
method_getImplementation(impMethod));
     } else {
-        Method impMethod = class_getInstanceMethod(self, 
@selector(replacementDealloc));
-        IMP anImp = impMethod->method_imp;
-        Method aMethod = class_getInstanceMethod(self, @selector(dealloc));
-        
         originalDealloc = aMethod->method_imp;
-        aMethod->method_imp = anImp;
-        
+        aMethod->method_imp = impMethod->method_imp;
         // Flush the method cache
         extern void _objc_flush_caches(Class);
         if (_objc_flush_caches != NULL)


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

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to