Index: chrome/browser/chromeos/input_method/ibus_controller_impl.cc |
diff --git a/chrome/browser/chromeos/input_method/ibus_controller_impl.cc b/chrome/browser/chromeos/input_method/ibus_controller_impl.cc |
index 266ab4c43089e4e3b1d608812f270bb67c44f218..8a3acdcd48241ae84c436fb680827518d8acd3d1 100644 |
--- a/chrome/browser/chromeos/input_method/ibus_controller_impl.cc |
+++ b/chrome/browser/chromeos/input_method/ibus_controller_impl.cc |
@@ -485,8 +485,14 @@ IBusControllerImpl::~IBusControllerImpl() { |
this); |
// Disconnect signals for the panel service as well. |
- IBusPanelService* ibus_panel_service = IBUS_PANEL_SERVICE( |
- g_object_get_data(G_OBJECT(ibus_), kPanelObjectKey)); |
+ // When Chrome is shutting down, g_object_get_data fails and returns NULL. |
+ // TODO(nona): Investigate the reason of failure(crosbug.com/129142). |
+ void* attached_data = g_object_get_data(G_OBJECT(ibus_), kPanelObjectKey); |
+ if (!attached_data) |
+ return; |
+ if (!G_TYPE_CHECK_INSTANCE_TYPE(attached_data, IBUS_TYPE_PANEL_SERVICE)) |
+ return; |
+ IBusPanelService* ibus_panel_service = IBUS_PANEL_SERVICE(attached_data); |
if (ibus_panel_service) { |
g_signal_handlers_disconnect_by_func( |
ibus_panel_service, |