Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Fix crash when closing Chrome without a callback function in place #373

Merged
merged 1 commit into from
Nov 8, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions appshell/appshell_extensions_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,23 @@ void SetLiveBrowserPid(int pid)

void LiveBrowserMgrMac::CloseLiveBrowserFireCallback(int valToSend)
{
CefRefPtr<CefListValue> responseArgs = m_closeLiveBrowserCallback->GetArgumentList();

// kill the timers
CloseLiveBrowserKillTimers();

// Stop listening for ws shutdown notifications
RemoveWorkspaceNotifications();

// Set common response args (callbackId and error)
responseArgs->SetInt(1, valToSend);

// Send response
m_browser->SendProcessMessage(PID_RENDERER, m_closeLiveBrowserCallback);
// Prepare response
if (m_closeLiveBrowserCallback) {

CefRefPtr<CefListValue> responseArgs = m_closeLiveBrowserCallback->GetArgumentList();

// Set common response args (callbackId and error)
responseArgs->SetInt(1, valToSend);

// Send response
m_browser->SendProcessMessage(PID_RENDERER, m_closeLiveBrowserCallback);
}

// Clear state
m_closeLiveBrowserCallback = NULL;
Expand Down