Jacek Caban : urlmon: Fix ref counting.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jan 9 13:52:47 CST 2006


Module: wine
Branch: refs/heads/master
Commit: fdc130f7536dead582624924723e23c984bdd209
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=fdc130f7536dead582624924723e23c984bdd209

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jan  9 17:20:04 2006 +0100

urlmon: Fix ref counting.

---

 dlls/urlmon/binding.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c
index 1533c1e..c7fe451 100644
--- a/dlls/urlmon/binding.c
+++ b/dlls/urlmon/binding.c
@@ -194,6 +194,8 @@ static ULONG WINAPI ProtocolStream_Relea
     if(!ref) {
         IInternetProtocol_Release(This->protocol);
         HeapFree(GetProcessHeap(), 0, This);
+
+        URLMON_UnlockModule();
     }
 
     return ref;
@@ -345,6 +347,8 @@ static ProtocolStream *create_stream(IIn
     IInternetProtocol_AddRef(protocol);
     ret->protocol = protocol;
 
+    URLMON_LockModule();
+
     return ret;
 }
 
@@ -380,8 +384,10 @@ static HRESULT WINAPI Binding_QueryInter
         *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(IBin
         HeapFree(GetProcessHeap(), 0, This->url);
 
         HeapFree(GetProcessHeap(), 0, This);
+
+        URLMON_UnlockModule();
     }
 
     return ref;
@@ -809,6 +817,8 @@ static HRESULT Binding_Create(LPCWSTR ur
         return E_NOTIMPL;
     }
 
+    URLMON_LockModule();
+
     ret = HeapAlloc(GetProcessHeap(), 0, sizeof(Binding));
 
     ret->lpBindingVtbl              = &BindingVtbl;




More information about the wine-cvs mailing list