mac-virtualcam: Fix memory leaks

Fixes some memory leaks Xcode has detected
This commit is contained in:
gxalpha 2021-04-12 23:36:14 +02:00 committed by Jim
parent 7282802d4e
commit b4f940533c
2 changed files with 6 additions and 1 deletions

View File

@ -69,16 +69,20 @@ HRESULT HardwarePlugIn_QueryInterface(CMIOHardwarePlugInRef self, REFIID uuid,
CFStringRef uuidString = CFUUIDCreateString(NULL, cfUuid);
CFStringRef hardwarePluginUuid =
CFUUIDCreateString(NULL, kCMIOHardwarePlugInInterfaceID);
CFRelease(cfUuid);
if (CFEqual(uuidString, hardwarePluginUuid)) {
// Return the interface;
sRefCount += 1;
*interface = OBSDALPlugInRef();
CFRelease(hardwarePluginUuid);
CFRelease(uuidString);
return kCMIOHardwareNoError;
} else {
DLogFunc(@"ERR Queried for some weird UUID %@", uuidString);
}
CFRelease(hardwarePluginUuid);
CFRelease(uuidString);
return E_NOINTERFACE;
}

View File

@ -276,6 +276,7 @@
pxdata, width, height, 8,
CVPixelBufferGetBytesPerRowOfPlane(pxbuffer, 0), rgbColorSpace,
kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Big);
CFRelease(rgbColorSpace);
NSParameterAssert(context);
NSGraphicsContext *nsContext = [NSGraphicsContext