Skip to content

Commit

Permalink
fix leaking handle in cap_dshow.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
berak committed Feb 21, 2017
1 parent 776c8c5 commit d7240d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/videoio/src/cap_dshow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,14 +877,12 @@ void videoDevice::NukeDownstream(IBaseFilter *pBF){

void videoDevice::destroyGraph(){
HRESULT hr = 0;
//int FuncRetval=0;
//int NumFilters=0;

int i = 0;
while (hr == NOERROR)
{
IEnumFilters * pEnum = 0;
ULONG cFetched;
ULONG cFetched = 0;

// We must get the enumerator again every time because removing a filter from the graph
// invalidates the enumerator. We always get only the first filter from each enumerator.
Expand Down Expand Up @@ -917,9 +915,11 @@ void videoDevice::destroyGraph(){
pFilter->Release();
pFilter = NULL;
}
else break;
pEnum->Release();
pEnum = NULL;

if (cFetched == 0)
break;
i++;
}

Expand Down

0 comments on commit d7240d1

Please sign in to comment.