[2/2] qmgr: Remove separate release helpers

Nikolay Sivov nsivov at codeweavers.com
Fri Jan 18 00:09:25 CST 2013


Remove separate release helpers
-------------- next part --------------
>From 61254933a3df6cc35a11e84800bea384c8631c39 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri, 18 Jan 2013 08:39:15 +0400
Subject: [PATCH 3/4] Remove separate release helpers

---
 dlls/qmgr/file.c |    7 ++++++-
 dlls/qmgr/job.c  |   15 ++++++---------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/dlls/qmgr/file.c b/dlls/qmgr/file.c
index 5fa5d09..9dc9814 100644
--- a/dlls/qmgr/file.c
+++ b/dlls/qmgr/file.c
@@ -86,7 +86,12 @@ static ULONG WINAPI BITS_IBackgroundCopyFile_Release(
     TRACE("(%p)->(%d)\n", This, ref);
 
     if (ref == 0)
-        BackgroundCopyFileDestructor(This);
+    {
+        IBackgroundCopyJob2_Release(&This->owner->IBackgroundCopyJob2_iface);
+        HeapFree(GetProcessHeap(), 0, This->info.LocalName);
+        HeapFree(GetProcessHeap(), 0, This->info.RemoteName);
+        HeapFree(GetProcessHeap(), 0, This);
+    }
 
     return ref;
 }
diff --git a/dlls/qmgr/job.c b/dlls/qmgr/job.c
index 26fc43e..4abf220 100644
--- a/dlls/qmgr/job.c
+++ b/dlls/qmgr/job.c
@@ -28,14 +28,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(qmgr);
 
-static void BackgroundCopyJobDestructor(BackgroundCopyJobImpl *This)
-{
-    This->cs.DebugInfo->Spare[0] = 0;
-    DeleteCriticalSection(&This->cs);
-    HeapFree(GetProcessHeap(), 0, This->displayName);
-    HeapFree(GetProcessHeap(), 0, This);
-}
-
 static inline BackgroundCopyJobImpl *impl_from_IBackgroundCopyJob2(IBackgroundCopyJob2 *iface)
 {
     return CONTAINING_RECORD(iface, BackgroundCopyJobImpl, IBackgroundCopyJob2_iface);
@@ -77,7 +69,12 @@ static ULONG WINAPI BITS_IBackgroundCopyJob_Release(IBackgroundCopyJob2 *iface)
     TRACE("(%p)->(%d)\n", This, ref);
 
     if (ref == 0)
-        BackgroundCopyJobDestructor(This);
+    {
+        This->cs.DebugInfo->Spare[0] = 0;
+        DeleteCriticalSection(&This->cs);
+        HeapFree(GetProcessHeap(), 0, This->displayName);
+        HeapFree(GetProcessHeap(), 0, This);
+    }
 
     return ref;
 }
-- 
1.7.10.4




More information about the wine-patches mailing list