From 1a999b33e1e1d468801d0a9a6208cc221d976cb0 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 25 Apr 2008 09:29:59 +0000 Subject: [PATCH] applied patch #1951248 - BgImage::Destroy re-enter crash fix git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5615 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/BgImage/BgImage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Contrib/BgImage/BgImage.cpp b/Contrib/BgImage/BgImage.cpp index b67490a6..8668d9a6 100644 --- a/Contrib/BgImage/BgImage.cpp +++ b/Contrib/BgImage/BgImage.cpp @@ -330,10 +330,12 @@ NSISFunc(Clear) { NSISFunc(Destroy) { bgBitmap.bReady = FALSE; - if (IsWindow(hwndParent)) + if (IsWindow(hwndParent) && oldProc) SetWindowLong(hwndParent, GWL_WNDPROC, (long)oldProc); - SendMessage(hWndImage, WM_CLOSE, 0, 0); + if (IsWindow(hWndImage)) + SendMessage(hWndImage, WM_CLOSE, 0, 0); hWndImage = 0; + oldProc = NULL; Clear(0, 0, 0, 0); UnregisterClass("NSISBGImage", g_hInstance); }