1

It is unclear to me how to properly stop and deallocate the MPPGraph. I created a framework very similar to this. Every time a dealloc is called in some way this exception is thrown. Thread 1: Exception: "waitUntilDoneWithError: should not be called on the main thread".

I don't know how to not call it in the main thread and was hoping someone had some insight on this.

Here you can find the swift code that is calling the mediapipe framework. This example has been created with the framework that can be found here.

Santiago Calvo
  • 116
  • 1
  • 6

1 Answers1

2

For anyone experiencing same issue. This has been addressed here and a solution has been proposed.

Edit: This last bit might be wrong but I used dealloc in this way:

- (void)dealloc {
  self.mediapipeGraph.delegate = nil;
  [self.mediapipeGraph cancel];
  // Ignore errors since we're cleaning up.
  [self.mediapipeGraph closeAllInputStreamsWithError:nil];
  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    [self.mediapipeGraph waitUntilDoneWithError:nil];
  });
}
Santiago Calvo
  • 116
  • 1
  • 6