Index: ppapi/proxy/plugin_dispatcher.cc |
=================================================================== |
--- ppapi/proxy/plugin_dispatcher.cc (revision 106763) |
+++ ppapi/proxy/plugin_dispatcher.cc (working copy) |
@@ -42,10 +42,18 @@ |
} // namespace |
InstanceData::InstanceData() |
- : fullscreen(PP_FALSE), flash_fullscreen(PP_FALSE) { |
+ : fullscreen(PP_FALSE), |
+ flash_fullscreen(PP_FALSE), |
+ mouse_lock_callback(PP_BlockUntilComplete()) { |
memset(&position, 0, sizeof(position)); |
} |
+InstanceData::~InstanceData() { |
+ // Run any pending mouse lock callback to prevent leaks. |
+ if (mouse_lock_callback.func) |
+ PP_RunAndClearCompletionCallback(&mouse_lock_callback, PP_ERROR_ABORTED); |
+} |
+ |
PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle, |
GetInterfaceFunc get_interface) |
: Dispatcher(remote_process_handle, get_interface), |