Index: chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc |
diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc |
index 0db7cbbb30e40f1e41c5e8c760e68c7d37b91cd4..8c1bab2bffa323bd043f37508976b744e74f1424 100644 |
--- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc |
+++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc |
@@ -109,8 +109,11 @@ bool AppShortcutLauncherItemController::IsVisible() const { |
void AppShortcutLauncherItemController::Launch(ash::LaunchSource source, |
int event_flags) { |
- launcher_controller()->LaunchAppWithLaunchId(app_id(), launch_id(), source, |
- event_flags); |
+ // Launching an app replaces shortcut item controller to app controller. As |
+ // result app_id_, launch_id_ are deleted during this call. Use local copies |
+ // to prevent crash condition. |
+ launcher_controller()->LaunchAppWithLaunchId( |
+ std::string(app_id()), std::string(launch_id()), source, event_flags); |
} |
ash::ShelfItemDelegate::PerformedAction |