1. Peter Hosey
  2. PRHTask

Commits

Peter Hosey  committed 24a84f3

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

  • Participants
  • Parent commits f787e15
  • Branches default

Comments (0)

Files changed (1)

File PRHTask.m

View file
  • Ignore whitespace
 }
 
 - (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];