Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: content/child/npapi/webplugin_delegate_impl_win.cc

Issue 105683004: Fix a crash in the NPAPI plugin code which occurs after we call the plugins window proc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/npapi/webplugin_delegate_impl_win.cc
===================================================================
--- content/child/npapi/webplugin_delegate_impl_win.cc (revision 238762)
+++ content/child/npapi/webplugin_delegate_impl_win.cc (working copy)
@@ -1022,7 +1022,13 @@
result = CallWindowProc(
delegate->plugin_wnd_proc_, hwnd, message, wparam, lparam);
- delegate->is_calling_wndproc = false;
+ // The plugin instance may have been destroyed in the CallWindowProc call
+ // above. This will also destroy the plugin window. Before attempting to
+ // access the WebPluginDelegateImpl instance we validate if the window is
+ // still valid.
+ if (::IsWindow(hwnd))
+ delegate->is_calling_wndproc = false;
+
g_current_plugin_instance = last_plugin_instance;
if (message == WM_NCDESTROY) {
@@ -1038,7 +1044,8 @@
ClearThrottleQueueForWindow(hwnd);
}
}
- delegate->last_message_ = old_message;
+ if (::IsWindow(hwnd))
+ delegate->last_message_ = old_message;
return result;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698