Commit fdc130f7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Fix ref counting.

parent 99306db9
......@@ -194,6 +194,8 @@ static ULONG WINAPI ProtocolStream_Release(IStream *iface)
if(!ref) {
IInternetProtocol_Release(This->protocol);
HeapFree(GetProcessHeap(), 0, This);
URLMON_UnlockModule();
}
return ref;
......@@ -345,6 +347,8 @@ static ProtocolStream *create_stream(IInternetProtocol *protocol)
IInternetProtocol_AddRef(protocol);
ret->protocol = protocol;
URLMON_LockModule();
return ret;
}
......@@ -380,8 +384,10 @@ static HRESULT WINAPI Binding_QueryInterface(IBinding *iface, REFIID riid, void
*ppv = SERVPROV(This);
}
if(*ppv)
if(*ppv) {
IBinding_AddRef(BINDING(This));
return S_OK;
}
WARN("Unsupported interface %s\n", debugstr_guid(riid));
return E_NOINTERFACE;
......@@ -419,6 +425,8 @@ static ULONG WINAPI Binding_Release(IBinding *iface)
HeapFree(GetProcessHeap(), 0, This->url);
HeapFree(GetProcessHeap(), 0, This);
URLMON_UnlockModule();
}
return ref;
......@@ -809,6 +817,8 @@ static HRESULT Binding_Create(LPCWSTR url, IBindCtx *pbc, REFIID riid, Binding *
return E_NOTIMPL;
}
URLMON_LockModule();
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(Binding));
ret->lpBindingVtbl = &BindingVtbl;
......
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