Author: rfm
Date: Thu May  1 14:48:51 2014
New Revision: 37826

URL: http://svn.gna.org/viewcvs/gnustep?rev=37826&view=rev
Log:
fix for possible premautre deallocation

Modified:
    libs/webservices/trunk/ChangeLog
    libs/webservices/trunk/GWSService.m

Modified: libs/webservices/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webservices/trunk/ChangeLog?rev=37826&r1=37825&r2=37826&view=diff
==============================================================================
--- libs/webservices/trunk/ChangeLog    (original)
+++ libs/webservices/trunk/ChangeLog    Thu May  1 14:48:51 2014
@@ -1,3 +1,8 @@
+2014-05-01 Richard Frith-Macdonald  <[email protected]>
+
+       * GWSService.m: Fix possible premature deallocation when removing
+       self as a client of the url handle.
+
 2014-03-28 Richard Frith-Macdonald  <[email protected]>
 
        * GWSService.m: Fix thread safety issue when -timeout: of a request

Modified: libs/webservices/trunk/GWSService.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/webservices/trunk/GWSService.m?rev=37826&r1=37825&r2=37826&view=diff
==============================================================================
--- libs/webservices/trunk/GWSService.m (original)
+++ libs/webservices/trunk/GWSService.m Thu May  1 14:48:51 2014
@@ -1980,6 +1980,10 @@
 - (void) URLHandle: (NSURLHandle*)sender
   resourceDidFailLoadingWithReason: (NSString*)reason
 {
+  /* Retain self during this process ... since removing self as a
+   * client of the handle could cause the receiver to be deallocated
+   */ 
+  RETAIN(self);
   [_lock lock];
   _completedIO = YES;
   threadRem(&_ioThread);
@@ -1991,6 +1995,7 @@
       [self _setProblem: reason];
     }
   [self _completed];
+  RELEASE(self);
 }
 
 - (void) URLHandleResourceDidBeginLoading: (NSURLHandle*)sender


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

Reply via email to