FW: [QCAP] patch 5, Fixing some object refcounting, take3
Rolf Kalbermatter
rolf.kalbermatter at citeng.com
Tue May 10 07:10:32 CDT 2005
Changelog
- dlls/qcap/capturegraph.c
- dlls/qcap/qcap_main.c
Make module global object refcounting work correctly and fix test
for DllCanUnloadNow to do the right thing.
Same as before but also setting debug cannel to qcap.
Rolf Kalbermatter
Index: capturegraph.c
===================================================================
RCS file: /home/wine/wine/dlls/qcap/capturegraph.c,v
retrieving revision 1.1
diff -u -r1.1 capturegraph.c
--- dlls/qcap/capturegraph.c 7 May 2005 18:18:39 -0000 1.1
+++ dlls/qcap/capturegraph.c 10 May 2005 10:24:32 -0000
@@ -1,4 +1,5 @@
-/* Capture Graph Builder, Minimal edition
+/*
+ * Capture Graph Builder, Minimal edition
*
* Copyright 2005 Maarten Lankhorst
* Copyright 2005 Rolf Kalbermatter
@@ -47,7 +48,7 @@
#include "wine/unicode.h"
#include "wine/debug.h"
-WINE_DEFAULT_DEBUG_CHANNEL(quartz);
+WINE_DEFAULT_DEBUG_CHANNEL(qcap);
static const WCHAR wcsInputPinName[] = {'i','n','p','u','t','
','p','i','n',0};
@@ -98,6 +99,7 @@
if (pCapture)
{
+ ObjectRefCount(TRUE);
pCapture->lpVtbl2 = &builder2_Vtbl;
pCapture->lpVtbl = &builder_Vtbl;
pCapture->ref = 1;
@@ -163,6 +165,7 @@
if (This->mygraph != NULL)
IGraphBuilder_Release((IGraphBuilder *)This->mygraph);
CoTaskMemFree(This);
+ ObjectRefCount(FALSE);
return 0;
}
else
Index: qcap_main.c
===================================================================
RCS file: /home/wine/wine/dlls/qcap/qcap_main.c,v
retrieving revision 1.5
diff -u -r1.5 qcap_main.c
--- dlls/qcap/qcap_main.c 7 May 2005 18:18:39 -0000 1.5
+++ dlls/qcap/qcap_main.c 10 May 2005 10:24:32 -0000
@@ -195,7 +195,7 @@
{
TRACE("\n");
- if (objects_ref == 0 || server_locks == 0)
+ if (objects_ref == 0 && server_locks == 0)
return S_OK;
return S_FALSE;
}
@@ -240,8 +240,10 @@
ULONG ref = InterlockedDecrement(&This->ref);
if (ref == 0)
+ {
HeapFree(GetProcessHeap(), 0, This);
-
+ ObjectRefCount(FALSE);
+ }
return ref;
}
@@ -268,9 +270,8 @@
/* No object created, update error if it isn't done already and
return */
if (!FAILED(hres))
hres = E_OUTOFMEMORY;
- return hres;
+ return hres;
}
-
if (SUCCEEDED(hres))
{
hres = IUnknown_QueryInterface(punk, riid, ppobj);
@@ -339,6 +340,7 @@
if (!factory)
return E_OUTOFMEMORY;
+ ObjectRefCount(TRUE);
factory->ITF_IClassFactory.lpVtbl = &DSCF_Vtbl;
factory->ref = 1;
More information about the wine-patches
mailing list