Piotr Caban : msvcr120: Fix exception object refcounting in __ExceptionPtrAssign.
Module: wine Branch: stable Commit: 1e8ac900d2de9da2b6621da9dcd515acc75856a4 URL: https://source.winehq.org/git/wine.git/?a=commit;h=1e8ac900d2de9da2b6621da9d... Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Jul 13 19:15:06 2017 +0200 msvcr120: Fix exception object refcounting in __ExceptionPtrAssign. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> (cherry picked from commit ab313dd3beb7e495b36f8320ffc2354b9c854d51) Signed-off-by: Michael Stefaniuc <mstefani(a)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 4d0d9b5..1277b40 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -1355,7 +1355,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); } /*********************************************************************
participants (1)
-
Alexandre Julliard