[PATCH 4/4] dmsynth: Lock/unlock the module only on creation/desctruction.

Michael Stefaniuc mstefani at redhat.de
Tue Jul 19 02:53:07 CDT 2016


Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
 dlls/dmsynth/synth.c     | 7 +++----
 dlls/dmsynth/synthsink.c | 5 +----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c
index fceeebd..88ba53e 100644
--- a/dlls/dmsynth/synth.c
+++ b/dlls/dmsynth/synth.c
@@ -72,8 +72,6 @@ static ULONG WINAPI IDirectMusicSynth8Impl_AddRef(LPDIRECTMUSICSYNTH8 iface)
 
     TRACE("(%p)->(): new ref = %u\n", This, ref);
 
-    DMSYNTH_LockModule();
-
     return ref;
 }
 
@@ -88,10 +86,9 @@ static ULONG WINAPI IDirectMusicSynth8Impl_Release(LPDIRECTMUSICSYNTH8 iface)
         if (This->pLatencyClock)
             IReferenceClock_Release(This->pLatencyClock);
         HeapFree(GetProcessHeap(), 0, This);
+        DMSYNTH_UnlockModule();
     }
 
-    DMSYNTH_UnlockModule();
-
     return ref;
 }
 
@@ -605,7 +602,9 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSynthImpl(REFIID riid, void **ppobj)
     obj->pCaps.dwEffectFlags = DMUS_EFFECT_REVERB;
     strcpyW(obj->pCaps.wszDescription, descrW);
 
+    DMSYNTH_LockModule();
     hr = IDirectMusicSynth8_QueryInterface(&obj->IDirectMusicSynth8_iface, riid, ppobj);
     IDirectMusicSynth8_Release(&obj->IDirectMusicSynth8_iface);
+
     return hr;
 }
diff --git a/dlls/dmsynth/synthsink.c b/dlls/dmsynth/synthsink.c
index 4720e59..7d148b0 100644
--- a/dlls/dmsynth/synthsink.c
+++ b/dlls/dmsynth/synthsink.c
@@ -67,8 +67,6 @@ static ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef(LPDIRECTMUSICSYNTHSINK ifac
 
     TRACE("(%p)->(): new ref = %u\n", This, ref);
 
-    DMSYNTH_LockModule();
-
     return ref;
 }
 
@@ -83,10 +81,9 @@ static ULONG WINAPI IDirectMusicSynthSinkImpl_Release(LPDIRECTMUSICSYNTHSINK ifa
         if (This->latency_clock)
             IReferenceClock_Release(This->latency_clock);
         HeapFree(GetProcessHeap(), 0, This);
+        DMSYNTH_UnlockModule();
     }
 
-    DMSYNTH_UnlockModule();
-
     return ref;
 }
 
-- 
2.5.5



More information about the wine-patches mailing list