Bugfix for bug #3767
Fixed a memory leak in cap_dshow.cpp in videoInput::setVideoSettingCamera(). The leak was caused by not releasing an IBaseFilter object created in a call to getDevice(). Tho object is now properly released.
This commit is contained in:
parent
946c09f58c
commit
9c285da329
@ -1825,6 +1825,8 @@ bool videoInput::setVideoSettingCamera(int deviceID, long Property, long lValue,
|
|||||||
hr = VDList[deviceID]->pVideoInputFilter->QueryInterface(IID_IAMCameraControl, (void**)&pIAMCameraControl);
|
hr = VDList[deviceID]->pVideoInputFilter->QueryInterface(IID_IAMCameraControl, (void**)&pIAMCameraControl);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
printf("Error\n");
|
printf("Error\n");
|
||||||
|
if(VDList[deviceID]->pVideoInputFilter)VDList[deviceID]->pVideoInputFilter->Release();
|
||||||
|
if(VDList[deviceID]->pVideoInputFilter)VDList[deviceID]->pVideoInputFilter = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1843,6 +1845,8 @@ bool videoInput::setVideoSettingCamera(int deviceID, long Property, long lValue,
|
|||||||
pIAMCameraControl->Set(Property, lValue, Flags);
|
pIAMCameraControl->Set(Property, lValue, Flags);
|
||||||
}
|
}
|
||||||
pIAMCameraControl->Release();
|
pIAMCameraControl->Release();
|
||||||
|
if(VDList[deviceID]->pVideoInputFilter)VDList[deviceID]->pVideoInputFilter->Release();
|
||||||
|
if(VDList[deviceID]->pVideoInputFilter)VDList[deviceID]->pVideoInputFilter = NULL;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user