Skip to content
This repository
Browse code

Applying fix manually from jmoody

  • Loading branch information...
commit f5b2f4af61c4c40e195e1e7db6f18bec84f854dc 1 parent c954c9c
Gabriel Handford authored September 26, 2012

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  Classes/GHTest/GHTesting.m
8  Classes/GHTest/GHTesting.m
@@ -251,12 +251,14 @@ - (NSArray *)loadTestsFromTarget:(id)target {
251 251
         if (strstr(name, "test") == name) {
252 252
           returnType = method_copyReturnType(currMethod);
253 253
           if (returnType) {
  254
+            // @gabriel from jjm - this does not appear to work, i am seeing
  255
+            //                     memory leaks on exceptions
254 256
             // This handles disposing of returnType for us even if an
255 257
             // exception should fly. Length +1 for the terminator, not that
256 258
             // the length really matters here, as we never reference inside
257 259
             // the data block.
258  
-            [NSData dataWithBytes:returnType
259  
-                                 length:strlen(returnType) + 1];
  260
+            //[NSData dataWithBytes:returnType
  261
+            //                     length:strlen(returnType) + 1];
260 262
           }
261 263
         }
262 264
         // TODO: If a test class is a subclass of another, and they reuse the
@@ -273,8 +275,10 @@ - (NSArray *)loadTestsFromTarget:(id)target {
273 275
           [invocation setSelector:sel];
274 276
           [invocations addObject:invocation];
275 277
         }
  278
+        if (returnType != NULL) free(returnType);
276 279
       }
277 280
     }
  281
+    if (methods != NULL) free(methods);
278 282
   }
279 283
   // Match SenTestKit and run everything in alphbetical order.
280 284
   [invocations sortUsingFunction:MethodSort context:nil];

0 notes on commit f5b2f4a

Please sign in to comment.
Something went wrong with that request. Please try again.