mac-virtualcam: Fix random crashes in applications loading VirtualCam

Without invalidating the mach port used for sharing the IOSurface
between OBS and the application displaying the virtual camera output,
IOKit seems to run into the issue of receiving "shared" mach ports,
possibly because of port exhaustion. IOKit requires a "new" port
however and crashes upon that error otherwise.

Co-authored-by: Steven Michaud <smichaud@pobox.com>
This commit is contained in:
PatTheMav
2022-10-19 01:59:11 +02:00
co-authored by Steven Michaud
parent c9b82da5a5
commit 36a86f5217
@@ -114,6 +114,7 @@
IOSurfaceRef surface = IOSurfaceLookupFromMachPort(
[framePort machPort]);
[framePort invalidate];
mach_port_deallocate(mach_task_self(),
[framePort machPort]);