Commits

Peter Hosey committed 24a84f3

Don't release any GCD objects we don't have. Doing so can cause a crash.

Comments (0)

Files changed (1)

 }
 
 - (void) dealloc {
-	dispatch_release(standardOutputReadSource);
-	dispatch_release(standardErrorReadSource);
+	void (^PRHDispatchRelease)(void *) = ^void(void *object) {
+		if (object != NULL)
+			dispatch_release(object);
+	};
 
-	dispatch_release(processExitSource);
+	PRHDispatchRelease(standardOutputReadSource);
+	PRHDispatchRelease(standardErrorReadSource);
+
+	PRHDispatchRelease(processExitSource);
 
 	[accumulatedStandardOutputData release];
 	[accumulatedStandardErrorData release];