diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 00:27:41 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 00:27:41 +0000 |
commit | df13a7e7e3231bffa81a1e94c4e91d3c69bb3389 (patch) | |
tree | 4f1269654189e6850f21b62797c110514e520edb /o3d/core | |
parent | 97652631f65b357867d01ffe260d5b488002b190 (diff) | |
download | chromium_src-df13a7e7e3231bffa81a1e94c4e91d3c69bb3389.zip chromium_src-df13a7e7e3231bffa81a1e94c4e91d3c69bb3389.tar.gz chromium_src-df13a7e7e3231bffa81a1e94c4e91d3c69bb3389.tar.bz2 |
Guard against the plugin being deleted unexpectedly.
BUG=none
TEST=manually stress tested plugin creation and destruction
Review URL: http://codereview.chromium.org/2848004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/core')
-rw-r--r-- | o3d/core/cross/client.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/o3d/core/cross/client.cc b/o3d/core/cross/client.cc index a6f9c32..271df8e42 100644 --- a/o3d/core/cross/client.cc +++ b/o3d/core/cross/client.cc @@ -252,6 +252,16 @@ void Client::RenderClientInner(bool present, bool send_callback) { profiler_->ProfileStart("Render callback"); if (send_callback) render_callback_manager_.Run(render_event_); + + // Calling back to JavaScript may have caused the plugin to be + // torn down. Guard carefully against this. + if (!profiler_.IsAvailable()) { + if (renderer_.IsAvailable()) { + renderer_->FinishRendering(); + } + return; + } + profiler_->ProfileStop("Render callback"); if (!render_tree_called_) { |