aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-comp-editor-registry.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-comp-editor-registry.c')
-rw-r--r--calendar/gui/e-comp-editor-registry.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/calendar/gui/e-comp-editor-registry.c b/calendar/gui/e-comp-editor-registry.c
index 1e9962c26f..68b33d11ff 100644
--- a/calendar/gui/e-comp-editor-registry.c
+++ b/calendar/gui/e-comp-editor-registry.c
@@ -50,13 +50,21 @@ destroy (GtkObject *obj)
{
ECompEditorRegistry *reg;
ECompEditorRegistryPrivate *priv;
-
+
reg = E_COMP_EDITOR_REGISTRY (obj);
priv = reg->priv;
- g_hash_table_destroy (priv->editors);
-
- g_free (priv);
+ if (priv) {
+ if (priv->editors) {
+ g_hash_table_destroy (priv->editors);
+ priv->editors = NULL;
+ }
+
+ g_free (priv);
+ reg->priv = NULL;
+ }
+
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (obj);
}
static void
@@ -195,10 +203,10 @@ editor_destroy_cb (GtkWidget *widget, gpointer data)
cal_component_get_uid (comp, &uid);
rdata = g_hash_table_lookup (priv->editors, uid);
- g_assert (rdata != NULL);
-
- g_hash_table_remove (priv->editors, rdata->uid);
- g_free (rdata->uid);
- g_free (rdata);
-}
+ if (rdata != NULL) {
+ g_hash_table_remove (priv->editors, rdata->uid);
+ g_free (rdata->uid);
+ g_free (rdata);
+ }
+}