mac-virtualcam: Fix memory leaks
Fixes some memory leaks Xcode has detected
This commit is contained in:
parent
7282802d4e
commit
b4f940533c
@ -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;
|
||||
}
|
||||
|
||||
|
@ -276,6 +276,7 @@
|
||||
pxdata, width, height, 8,
|
||||
CVPixelBufferGetBytesPerRowOfPlane(pxbuffer, 0), rgbColorSpace,
|
||||
kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Big);
|
||||
CFRelease(rgbColorSpace);
|
||||
NSParameterAssert(context);
|
||||
|
||||
NSGraphicsContext *nsContext = [NSGraphicsContext
|
||||
|
Loading…
x
Reference in New Issue
Block a user