summaryrefslogtreecommitdiff
path: root/src/ibusregistry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ibusregistry.c')
-rw-r--r--src/ibusregistry.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/ibusregistry.c b/src/ibusregistry.c
index 2830a087..8e9ada94 100644
--- a/src/ibusregistry.c
+++ b/src/ibusregistry.c
@@ -1,9 +1,9 @@
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/* vim:set et sts=4: */
/* bus - The Input Bus
- * Copyright (C) 2013 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2013 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2013 Red Hat, Inc.
+ * Copyright (C) 2015 Peng Huang <shawn.p.huang@gmail.com>
+ * Copyright (C) 2015 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -374,12 +374,26 @@ ibus_registry_check_modification (IBusRegistry *registry)
g_assert (IBUS_IS_REGISTRY (registry));
for (p = registry->priv->observed_paths; p != NULL; p = p->next) {
+ if (!IBUS_IS_OBSERVED_PATH (p->data)) {
+ g_warning ("The registry cache of observed_paths might be " \
+ "broken and have to generate the cache again.");
+ g_list_free_full (registry->priv->observed_paths, g_object_unref);
+ registry->priv->observed_paths = NULL;
+ return TRUE;
+ }
if (ibus_observed_path_check_modification (
(IBusObservedPath *) p->data))
return TRUE;
}
for (p = registry->priv->components; p != NULL; p = p->next) {
+ if (!IBUS_IS_COMPONENT (p->data)) {
+ g_warning ("The registry cache of components might be " \
+ "broken and have to generate the cache again.");
+ g_list_free_full (registry->priv->components, g_object_unref);
+ registry->priv->components = NULL;
+ return TRUE;
+ }
if (ibus_component_check_modification ((IBusComponent *) p->data))
return TRUE;
}