OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/input_method/ibus_engine_controller.h" | 5 #include "chrome/browser/chromeos/input_method/ibus_engine_controller.h" |
6 | 6 |
7 #if defined(HAVE_IBUS) | 7 #if defined(HAVE_IBUS) |
8 #include <ibus.h> | 8 #include <ibus.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 } else { | 879 } else { |
880 connection->second->engine_instances_.erase(chromeos_engine); | 880 connection->second->engine_instances_.erase(chromeos_engine); |
881 if (connection->second->active_engine_ == chromeos_engine) { | 881 if (connection->second->active_engine_ == chromeos_engine) { |
882 connection->second->active_engine_ = NULL; | 882 connection->second->active_engine_ = NULL; |
883 } | 883 } |
884 } | 884 } |
885 if (chromeos_engine->table) { | 885 if (chromeos_engine->table) { |
886 g_object_unref(chromeos_engine->table); | 886 g_object_unref(chromeos_engine->table); |
887 chromeos_engine->table = NULL; | 887 chromeos_engine->table = NULL; |
888 } | 888 } |
889 if (ibus_bus_is_connected(chromeos_engine->connection->ibus_)) { | 889 if (chromeos_engine->connection && |
890 // We can't call destroy function without ibus-daemon connection, | 890 ibus_bus_is_connected(chromeos_engine->connection->ibus_)) { |
| 891 // Connection may be NULL since extension IME can be uninstalled before |
| 892 // |OnDestroy| is called. |
| 893 // We can't call |destroy| function without ibus-daemon connection, |
891 // otherwise browser goes into deadlock state. | 894 // otherwise browser goes into deadlock state. |
892 // TODO(nona): investigate the reason of dead-lock. | 895 // TODO(nona): investigate the reason of dead-lock. |
893 IBUS_OBJECT_CLASS(ibus_chromeos_engine_parent_class) | 896 IBUS_OBJECT_CLASS(ibus_chromeos_engine_parent_class) |
894 ->destroy(IBUS_OBJECT(chromeos_engine)); | 897 ->destroy(IBUS_OBJECT(chromeos_engine)); |
895 } | 898 } |
896 } | 899 } |
897 | 900 |
898 IBusEngineController::Observer* observer_; | 901 IBusEngineController::Observer* observer_; |
899 IBusBus* ibus_; | 902 IBusBus* ibus_; |
900 IBusChromeOSEngine* active_engine_; | 903 IBusChromeOSEngine* active_engine_; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 #else | 965 #else |
963 return NULL; | 966 return NULL; |
964 #endif | 967 #endif |
965 } | 968 } |
966 | 969 |
967 IBusEngineController::~IBusEngineController() { | 970 IBusEngineController::~IBusEngineController() { |
968 } | 971 } |
969 | 972 |
970 } // namespace input_method | 973 } // namespace input_method |
971 } // namespace chromeos | 974 } // namespace chromeos |
OLD | NEW |