ole32: Release the proxy buffer object on the last release of the proxy's outer unknown.
Release the proxy buffer object on the last release of the proxy's outer unknown, otherwise memory is leaked for the Ndr implementation of IRpcProxyBuffer. Fix up the hand-coded proxies to match the behaviour from the Ndr implementation.
This commit is contained in:
parent
d4245634ca
commit
875390110f
|
@ -543,9 +543,7 @@ static void ifproxy_destroy(struct ifproxy * This)
|
||||||
This->chan = NULL;
|
This->chan = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* note: we don't call Release for This->proxy because its lifetime is
|
if (This->proxy) IRpcProxyBuffer_Release(This->proxy);
|
||||||
* controlled by the return value from ClientIdentity_Release, which this
|
|
||||||
* function is always called from */
|
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
|
||||||
const CLSID CLSID_DfMarshal = { 0x0000030b, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46} };
|
const CLSID CLSID_DfMarshal = { 0x0000030b, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46} };
|
||||||
const CLSID CLSID_PSFactoryBuffer = { 0x00000320, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46} };
|
const CLSID CLSID_PSFactoryBuffer = { 0x00000320, 0, 0, {0xc0, 0, 0, 0, 0, 0, 0, 0x46} };
|
||||||
|
|
||||||
|
static ULONG WINAPI RURpcProxyBufferImpl_Release(LPRPCPROXYBUFFER iface);
|
||||||
|
|
||||||
/* From: http://msdn.microsoft.com/library/en-us/com/cmi_m_4lda.asp
|
/* From: http://msdn.microsoft.com/library/en-us/com/cmi_m_4lda.asp
|
||||||
*
|
*
|
||||||
* The first time a client requests a pointer to an interface on a
|
* The first time a client requests a pointer to an interface on a
|
||||||
|
@ -345,18 +347,11 @@ static ULONG WINAPI CFProxy_AddRef(LPCLASSFACTORY iface) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI CFProxy_Release(LPCLASSFACTORY iface) {
|
static ULONG WINAPI CFProxy_Release(LPCLASSFACTORY iface) {
|
||||||
ULONG ref;
|
|
||||||
ICOM_THIS_MULTI(CFProxy,lpvtbl_cf,iface);
|
ICOM_THIS_MULTI(CFProxy,lpvtbl_cf,iface);
|
||||||
if (This->outer_unknown)
|
if (This->outer_unknown)
|
||||||
ref = IUnknown_Release(This->outer_unknown);
|
return IUnknown_Release(This->outer_unknown);
|
||||||
else
|
else
|
||||||
ref = InterlockedDecrement(&This->ref);
|
return IRpcProxyBufferImpl_Release((IRpcProxyBuffer *)&This->lpvtbl_proxy);
|
||||||
|
|
||||||
if (!ref) {
|
|
||||||
if (This->chanbuf) IRpcChannelBuffer_Release(This->chanbuf);
|
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
|
||||||
}
|
|
||||||
return ref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI CFProxy_CreateInstance(
|
static HRESULT WINAPI CFProxy_CreateInstance(
|
||||||
|
@ -712,19 +707,12 @@ static ULONG WINAPI RemUnkProxy_AddRef(LPREMUNKNOWN iface)
|
||||||
static ULONG WINAPI RemUnkProxy_Release(LPREMUNKNOWN iface)
|
static ULONG WINAPI RemUnkProxy_Release(LPREMUNKNOWN iface)
|
||||||
{
|
{
|
||||||
RemUnkProxy *This = (RemUnkProxy *)iface;
|
RemUnkProxy *This = (RemUnkProxy *)iface;
|
||||||
ULONG refs;
|
|
||||||
|
|
||||||
TRACE("(%p)->Release()\n",This);
|
TRACE("(%p)->Release()\n",This);
|
||||||
if (This->outer_unknown)
|
if (This->outer_unknown)
|
||||||
refs = IUnknown_Release(This->outer_unknown);
|
return IUnknown_Release(This->outer_unknown);
|
||||||
else
|
else
|
||||||
refs = InterlockedDecrement(&This->refs);
|
return IRpcProxyBufferImpl_Release((IRpcProxyBuffer *)&This->lpvtbl_proxy);
|
||||||
|
|
||||||
if (!refs) {
|
|
||||||
if (This->chan) IRpcChannelBuffer_Release(This->chan);
|
|
||||||
HeapFree(GetProcessHeap(),0,This);
|
|
||||||
}
|
|
||||||
return refs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI RemUnkProxy_RemQueryInterface(LPREMUNKNOWN iface,
|
static HRESULT WINAPI RemUnkProxy_RemQueryInterface(LPREMUNKNOWN iface,
|
||||||
|
|
Loading…
Reference in New Issue