Commit 8177b479 authored by Octavian Voicu's avatar Octavian Voicu Committed by Alexandre Julliard

oleaut32: Fix leak in typelib marshaler when invoking IDispatch methods.

parent 82ef9f96
......@@ -1000,6 +1000,12 @@ static void test_typelibmarshal(void)
IKindaEnumWidget_Release(pKEW);
/* call GetTypeInfoCount (direct) */
hr = IWidget_GetTypeInfoCount(pWidget, &uval);
ok_ole_success(hr, IWidget_GetTypeInfoCount);
hr = IWidget_GetTypeInfoCount(pWidget, &uval);
ok_ole_success(hr, IWidget_GetTypeInfoCount);
hr = IWidget_QueryInterface(pWidget, &IID_IDispatch, (void **)&pDispatch);
ok_ole_success(hr, IWidget_QueryInterface);
......
......@@ -2002,16 +2002,19 @@ TMStubImpl_Invoke(
if (This->dispatch_derivative && xmsg->iMethod < sizeof(IDispatchVtbl)/sizeof(void *))
{
IPSFactoryBuffer *factory_buffer;
hres = get_facbuf_for_iid(&IID_IDispatch, &factory_buffer);
if (hres == S_OK)
if (!This->dispatch_stub)
{
hres = IPSFactoryBuffer_CreateStub(factory_buffer, &IID_IDispatch,
This->pUnk, &This->dispatch_stub);
IPSFactoryBuffer_Release(factory_buffer);
IPSFactoryBuffer *factory_buffer;
hres = get_facbuf_for_iid(&IID_IDispatch, &factory_buffer);
if (hres == S_OK)
{
hres = IPSFactoryBuffer_CreateStub(factory_buffer, &IID_IDispatch,
This->pUnk, &This->dispatch_stub);
IPSFactoryBuffer_Release(factory_buffer);
}
if (hres != S_OK)
return hres;
}
if (hres != S_OK)
return hres;
return IRpcStubBuffer_Invoke(This->dispatch_stub, xmsg, rpcchanbuf);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment