diff --git a/atom/browser/ui/cocoa/atom_menu_controller.mm b/atom/browser/ui/cocoa/atom_menu_controller.mm index 3e12c90bea8a..cecf30ce1c88 100644 --- a/atom/browser/ui/cocoa/atom_menu_controller.mm +++ b/atom/browser/ui/cocoa/atom_menu_controller.mm @@ -123,7 +123,9 @@ static base::scoped_nsobject recentDocumentsMenuSwap_; [menu_ cancelTracking]; isMenuOpen_ = NO; model_->MenuWillClose(); - closeCallback.Run(); + if (!closeCallback.is_null()) { + BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, closeCallback); + } } }