Author: mlytwyn
Date: Thu Feb 25 01:07:53 2016
New Revision: 39412

URL: http://svn.gna.org/viewcvs/gnustep?rev=39412&view=rev
Log:
NSConnection throwing expcetion causing autorelease pool leak in 
NSDistributedNotificationCenter

Modified:
    
libs/base/branches/gnustep_testplant_branch/Source/NSDistributedNotificationCenter.m

Modified: 
libs/base/branches/gnustep_testplant_branch/Source/NSDistributedNotificationCenter.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSDistributedNotificationCenter.m?rev=39412&r1=39411&r2=39412&view=diff
==============================================================================
--- 
libs/base/branches/gnustep_testplant_branch/Source/NSDistributedNotificationCenter.m
        (original)
+++ 
libs/base/branches/gnustep_testplant_branch/Source/NSDistributedNotificationCenter.m
        Thu Feb 25 01:07:53 2016
@@ -742,10 +742,24 @@
               NSAutoreleasePool        *pool = [NSAutoreleasePool new];
 
               [NSThread sleepForTimeInterval: 0.05];
-             _remote = [NSConnection
-               rootProxyForConnectionWithRegisteredName: service
-               host: host usingNameServer: ns];
-              [_remote retain];
+              
+              NS_DURING
+              {
+                _remote = [NSConnection
+                           rootProxyForConnectionWithRegisteredName: service
+                           host: host usingNameServer: ns];
+                [_remote retain];
+              }
+              NS_HANDLER
+              {
+                NSLog(@"%s:exception: %@", __PRETTY_FUNCTION__, 
localException);
+                _remote = nil;
+                // Re-raise??? Another exeption will be raised below...
+                //[pool drain]; // Avoid autorelease pool leak...
+                //[localException raise];
+              }
+              NS_ENDHANDLER
+
               [pool drain];
            }
          if (_remote == nil)


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to