# HG changeset patch # User Jens Alfke # Date 1248195850 25200 # Node ID 981f9d604c88ae2f79ddae132e24eda8267041d2 # Parent dd637bdd214e6fa8f66a1a9b76c97e37499bf987 Prevent crash if MYBonjourQuery is released during response handling diff -r dd637bdd214e -r 981f9d604c88 Bonjour/MYBonjourQuery.m --- a/Bonjour/MYBonjourQuery.m Mon Jul 20 14:50:49 2009 -0700 +++ b/Bonjour/MYBonjourQuery.m Tue Jul 21 10:04:10 2009 -0700 @@ -106,6 +106,7 @@ void *context) { MYBonjourQuery *query = context; + [query retain]; @try{ //LogTo(Bonjour, @"queryCallback for %@ (err=%i)", context,errorCode); if (!errorCode) @@ -116,6 +117,7 @@ flags: flags]; }catchAndReport(@"MYBonjourResolver query callback"); [query gotResponse: errorCode]; + [query release]; }