summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-21 22:17:55 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-21 22:17:55 +0000
commitd21fb774bbd1498cc392d9636338660b58f2ac72 (patch)
tree462e22d7c6a59ed114e7727acb02a49455d706bf /o3d
parent4d5a37cdab721adbb9f64a3a0a11be16df8f91e1 (diff)
downloadchromium_src-d21fb774bbd1498cc392d9636338660b58f2ac72.zip
chromium_src-d21fb774bbd1498cc392d9636338660b58f2ac72.tar.gz
chromium_src-d21fb774bbd1498cc392d9636338660b58f2ac72.tar.bz2
Fixed crash introduced by recent full-screen work under
http://codereview.chromium.org/210005 . Restore the browser's original WNDPROC on the plugin window before destroying the O3D plugin, so that Windows does not attempt to call into the O3D plugin after it has been unloaded. Review URL: http://codereview.chromium.org/208050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/plugin/win/main_win.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/o3d/plugin/win/main_win.cc b/o3d/plugin/win/main_win.cc
index 85bc28c..0fd3148 100644
--- a/o3d/plugin/win/main_win.cc
+++ b/o3d/plugin/win/main_win.cc
@@ -657,6 +657,16 @@ void CleanupAllWindows(PluginObject *obj) {
DCHECK(obj->GetContentHWnd());
DCHECK(obj->GetPluginHWnd());
::KillTimer(obj->GetContentHWnd(), 0);
+
+ // Restore the original WNDPROC on the plugin window so that we
+ // don't attempt to call into the O3D DLL after it's been unloaded.
+ LONG_PTR origWndProc = reinterpret_cast<LONG_PTR>(
+ GetProp(obj->GetPluginHWnd(),
+ kOrigWndProcName));
+ DCHECK(origWndProc != NULL);
+ RemoveProp(obj->GetPluginHWnd(), kOrigWndProcName);
+ SetWindowLongPtr(obj->GetPluginHWnd(), GWLP_WNDPROC, origWndProc);
+
PluginObject::ClearPluginProperty(obj->GetContentHWnd());
PluginObject::ClearPluginProperty(obj->GetPluginHWnd());
::DestroyWindow(obj->GetContentHWnd());