DCOM: Disconnect TMStub From Server Object on Release

Robert Shearman rob at codeweavers.com
Fri Jul 30 07:14:13 CDT 2004


Changelog:

Mike Hearn <mh at codeweavers.com>
Disconnect the server object from the stub on stub destruction.


-------------- next part --------------
Index: wine/dlls/oleaut32/tmarshal.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/tmarshal.c,v
retrieving revision 1.27
diff -u -r1.27 tmarshal.c
--- wine/dlls/oleaut32/tmarshal.c	28 Jun 2004 23:51:24 -0000	1.27
+++ wine/dlls/oleaut32/tmarshal.c	30 Jul 2004 12:10:02 -0000
@@ -1458,6 +1458,8 @@
 static ULONG WINAPI
 TMStubImpl_AddRef(LPRPCSTUBBUFFER iface) {
     ICOM_THIS(TMStubImpl,iface);
+        
+    TRACE("(%p) before %lu\n", This, This->ref);
 
     This->ref++;
     return This->ref;
@@ -1467,9 +1469,14 @@
 TMStubImpl_Release(LPRPCSTUBBUFFER iface) {
     ICOM_THIS(TMStubImpl,iface);
 
+    TRACE("(%p) after %lu\n", This, This->ref-1);
+
     This->ref--;
     if (This->ref)
 	return This->ref;
+
+    IRpcStubBuffer_Disconnect(iface);
+
     HeapFree(GetProcessHeap(),0,This);
     return 0;
 }
@@ -1478,6 +1485,8 @@
 TMStubImpl_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN pUnkServer) {
     ICOM_THIS(TMStubImpl,iface);
 
+    TRACE("(%p)->(%p)\n", This, pUnkServer);
+
     IUnknown_AddRef(pUnkServer);
     This->pUnk = pUnkServer;
     return S_OK;
@@ -1487,6 +1496,8 @@
 TMStubImpl_Disconnect(LPRPCSTUBBUFFER iface) {
     ICOM_THIS(TMStubImpl,iface);
 
+    TRACE("(%p)->()\n", This);
+
     IUnknown_Release(This->pUnk);
     This->pUnk = NULL;
     return;
@@ -1736,6 +1747,7 @@
     memcpy(&(stub->iid),riid,sizeof(*riid));
     hres = IRpcStubBuffer_Connect((LPRPCSTUBBUFFER)stub,pUnkServer);
     *ppStub 		= (LPRPCSTUBBUFFER)stub;
+    TRACE("IRpcStubBuffer: %p\n", stub);
     if (hres)
 	FIXME("Connect to pUnkServer failed?\n");
     return hres;


More information about the wine-patches mailing list