diff options
Diffstat (limited to 'chrome_frame/chrome_frame_automation.cc')
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index ae643c8..746340d 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -712,7 +712,14 @@ void ChromeFrameAutomationClient::InstallExtensionComplete( } void ChromeFrameAutomationClient::OnChromeFrameHostMoved() { - tab_->OnHostMoved(); + // Use a local var to avoid the small possibility of getting the tab_ + // member be cleared while we try to use it. + // Note that TabProxy is a RefCountedThreadSafe object, so we should be OK. + scoped_refptr<TabProxy> tab(tab_); + // There also is a possibility that tab_ has not been set yet, + // so we still need to test for NULL. + if (tab.get() != NULL) + tab->OnHostMoved(); } void ChromeFrameAutomationClient::LoadExpandedExtension( |