Update of /cvsroot/artoolkit/artoolkit/lib/SRC/VideoWin32DirectShow
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv18182/lib/SRC/VideoWin32DirectShow
Modified Files:
videoWin32DirectShow.cpp
Log Message:
- minor fix for situations when ar2VideoClose is been called twice.
Index: videoWin32DirectShow.cpp
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoWin32DirectShow/videoWin32DirectShow.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** videoWin32DirectShow.cpp 29 Aug 2006 04:19:16 -0000 1.8
--- videoWin32DirectShow.cpp 28 Sep 2006 05:50:16 -0000 1.9
***************
*** 172,185 ****
int ar2VideoClose(AR2VideoParamT *vid)
{
! if (vid == NULL) return (-1);
! if (vid->graphManager == NULL) return (-1);
! if (vid->bufferCheckedOut) vid->graphManager->CheckinMemoryBuffer(vid->g_Handle, true);
! vid->graphManager->Stop();
! delete vid->graphManager;
! vid->graphManager = NULL;
! free (vid);
! return(0);
}
--- 172,200 ----
int ar2VideoClose(AR2VideoParamT *vid)
{
! int _ret = -1;
!
! if (vid == NULL) return (_ret);
!
! if (vid->graphManager != NULL) {
! if (vid->bufferCheckedOut)
! vid->graphManager->CheckinMemoryBuffer(vid->g_Handle, true);
!
! vid->graphManager->Stop();
! delete vid->graphManager;
! vid->graphManager = NULL;
!
! _ret = 0;
! }
!
! free(vid);
!
! // do not assume free NULL's the pointer
! vid = NULL;
!
! // COM should be closed down in the same context
! CoUninitialize();
! return(_ret);
}
|