From baae49fa8299fb755647d5ce6f012d80563c5524 Mon Sep 17 00:00:00 2001 From: "av%netscape.com" Date: Thu, 10 Oct 2002 04:23:18 +0000 Subject: [PATCH] Bug 173206 -- crash after Shockwave registration, r=serge, sr=beard, a=asa git-svn-id: svn://10.0.0.236/trunk@131671 18797224-902f-48f8-a5cc-f745e15eee43 --- .../plugin/base/src/nsPluginNativeWindowWin.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp b/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp index b646da4579a..80db469c16c 100644 --- a/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginNativeWindowWin.cpp @@ -367,7 +367,7 @@ nsresult nsPluginNativeWindowWin::SubclassAndAssociateWindow() nsresult nsPluginNativeWindowWin::UndoSubclassAndAssociateWindow() { - // undo association and release plugin instance + // release plugin instance SetPluginInstance(nsnull); // remove window property @@ -376,8 +376,12 @@ nsresult nsPluginNativeWindowWin::UndoSubclassAndAssociateWindow() ::RemoveProp(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION); // restore the original win proc - if (mPluginWinProc) - SubclassWindow(hWnd, (LONG)mPluginWinProc); + // but only do this if this were us last time + if (mPluginWinProc) { + WNDPROC currentWndProc = (WNDPROC)::GetWindowLong(hWnd, GWL_WNDPROC); + if (currentWndProc == PluginWndProc) + SubclassWindow(hWnd, (LONG)mPluginWinProc); + } return NS_OK; }