From 21fabde48a69423c8c89bd77dc56459ec150b99b Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Fri, 4 Feb 2011 14:51:27 -0500 Subject: [PATCH] Bug 630697 - Flash crash [@ _SEH_prolog ]; r=bsmedberg a=blocking-final+ --- dom/plugins/PluginInstanceChild.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dom/plugins/PluginInstanceChild.cpp b/dom/plugins/PluginInstanceChild.cpp index 5db10429ec..48dbf5a84a 100644 --- a/dom/plugins/PluginInstanceChild.cpp +++ b/dom/plugins/PluginInstanceChild.cpp @@ -1393,9 +1393,13 @@ PluginInstanceChild::SetWindowLongAHook(HWND hWnd, GetProp(hWnd, kPluginInstanceChildProperty)); // Hook our subclass back up, just like we do on setwindow. - self->mPluginWndProc = - reinterpret_cast(sUser32SetWindowLongAHookStub(hWnd, nIndex, - reinterpret_cast(PluginWindowProc))); + WNDPROC currentProc = + reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_WNDPROC)); + if (currentProc != PluginWindowProc) { + self->mPluginWndProc = + reinterpret_cast(sUser32SetWindowLongAHookStub(hWnd, nIndex, + reinterpret_cast(PluginWindowProc))); + } return proc; } @@ -1422,9 +1426,13 @@ PluginInstanceChild::SetWindowLongWHook(HWND hWnd, GetProp(hWnd, kPluginInstanceChildProperty)); // Hook our subclass back up, just like we do on setwindow. - self->mPluginWndProc = - reinterpret_cast(sUser32SetWindowLongWHookStub(hWnd, nIndex, - reinterpret_cast(PluginWindowProc))); + WNDPROC currentProc = + reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_WNDPROC)); + if (currentProc != PluginWindowProc) { + self->mPluginWndProc = + reinterpret_cast(sUser32SetWindowLongAHookStub(hWnd, nIndex, + reinterpret_cast(PluginWindowProc))); + } return proc; } -- 2.11.4.GIT