Prevent crash if MYBonjourQuery is released during response handling
authorJens Alfke <jens@mooseyard.com>
Tue Jul 21 10:04:10 2009 -0700 (2009-07-21)
changeset 61981f9d604c88
parent 60 dd637bdd214e
child 62 8713f2d6a4c5
Prevent crash if MYBonjourQuery is released during response handling
Bonjour/MYBonjourQuery.m
     1.1 --- a/Bonjour/MYBonjourQuery.m	Mon Jul 20 14:50:49 2009 -0700
     1.2 +++ b/Bonjour/MYBonjourQuery.m	Tue Jul 21 10:04:10 2009 -0700
     1.3 @@ -106,6 +106,7 @@
     1.4                             void                                *context)
     1.5  {
     1.6      MYBonjourQuery *query = context;
     1.7 +    [query retain];
     1.8      @try{
     1.9          //LogTo(Bonjour, @"queryCallback for %@ (err=%i)", context,errorCode);
    1.10          if (!errorCode)
    1.11 @@ -116,6 +117,7 @@
    1.12                                   flags: flags];
    1.13      }catchAndReport(@"MYBonjourResolver query callback");
    1.14      [query gotResponse: errorCode];
    1.15 +    [query release];
    1.16  }
    1.17  
    1.18