Piotr Caban : msvcr120: Fix exception object refcounting in __ExceptionPtrAssign.

Alexandre Julliard julliard at winehq.org
Thu Jul 13 14:41:34 CDT 2017


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jul 13 19:15:06 2017 +0200

msvcr120: Fix exception object refcounting in __ExceptionPtrAssign.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/cpp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c
index b3bfc2e..2e17f62 100644
--- a/dlls/msvcrt/cpp.c
+++ b/dlls/msvcrt/cpp.c
@@ -1773,7 +1773,12 @@ void __cdecl __ExceptionPtrAssign(exception_ptr *ep, const exception_ptr *assign
     TRACE("(%p %p)\n", ep, assign);
 
     /* don't destroy object stored in ep */
+    if (ep->ref)
+        InterlockedDecrement(ep->ref);
+
     *ep = *assign;
+    if (ep->ref)
+        InterlockedIncrement(ep->ref);
 }
 
 /*********************************************************************




More information about the wine-cvs mailing list