aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-02-27 05:58:43 +0800
committerHans Petter <hansp@src.gnome.org>2003-02-27 05:58:43 +0800
commit34bd7b09846f80dd879dc554b7c79e0512a7d1a8 (patch)
treec14d83cbbae991a85ca0b2979cb89e67e6fb3151
parentf29756cf1abe1307de8c70bb556481e23674140c (diff)
downloadgsoc2013-evolution-34bd7b09846f80dd879dc554b7c79e0512a7d1a8.tar
gsoc2013-evolution-34bd7b09846f80dd879dc554b7c79e0512a7d1a8.tar.gz
gsoc2013-evolution-34bd7b09846f80dd879dc554b7c79e0512a7d1a8.tar.bz2
gsoc2013-evolution-34bd7b09846f80dd879dc554b7c79e0512a7d1a8.tar.lz
gsoc2013-evolution-34bd7b09846f80dd879dc554b7c79e0512a7d1a8.tar.xz
gsoc2013-evolution-34bd7b09846f80dd879dc554b7c79e0512a7d1a8.tar.zst
gsoc2013-evolution-34bd7b09846f80dd879dc554b7c79e0512a7d1a8.zip
Fixes Ximian #38306.
2003-02-26 Hans Petter Jansson <hpj@ximian.com> Fixes Ximian #38306. * gui/e-itip-control.c (clean_up): Do nothing if the private structure has been freed. Don't call non-g_free() freers with NULL pointers. (destroy): Do nothing if the private structure has been freed. Clear pointers to freed blocks. svn path=/trunk/; revision=20077
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/e-itip-control.c54
2 files changed, 44 insertions, 19 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 1037b89039..35feb32e26 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,12 @@
+2003-02-26 Hans Petter Jansson <hpj@ximian.com>
+
+ Fixes Ximian #38306.
+
+ * gui/e-itip-control.c (clean_up): Do nothing if the private structure
+ has been freed. Don't call non-g_free() freers with NULL pointers.
+ (destroy): Do nothing if the private structure has been freed. Clear
+ pointers to freed blocks.
+
2003-02-25 Hans Petter Jansson <hpj@ximian.com>
* gui/print.c (print_calendar): Use fixed margins of 5% of page
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index a540a65bef..945824797c 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -330,18 +330,26 @@ clean_up (EItipControl *itip)
EItipControlPrivate *priv;
priv = itip->priv;
+ if (!priv)
+ return;
g_free (priv->vcalendar);
priv->vcalendar = NULL;
- if (priv->comp)
+ if (priv->comp) {
g_object_unref (priv->comp);
- priv->comp = NULL;
+ priv->comp = NULL;
+ }
+
+ if (priv->top_level) {
+ icalcomponent_free (priv->top_level);
+ priv->top_level = NULL;
+ }
- icalcomponent_free (priv->top_level);
- priv->top_level = NULL;
- icalcomponent_free (priv->main_comp);
- priv->main_comp = NULL;
+ if (priv->main_comp) {
+ icalcomponent_free (priv->main_comp);
+ priv->main_comp = NULL;
+ }
priv->ical_comp = NULL;
priv->current = 0;
@@ -369,22 +377,30 @@ destroy (GtkObject *obj)
priv = itip->priv;
- clean_up (itip);
+ if (priv) {
+ clean_up (itip);
- priv->accounts = NULL;
+ priv->accounts = NULL;
- if (priv->event_clients) {
- for (i = 0; i < priv->event_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->event_clients, i));
- g_ptr_array_free (priv->event_clients, TRUE);
- }
- if (priv->task_clients) {
- for (i = 0; i < priv->task_clients->len; i++)
- g_object_unref (g_ptr_array_index (priv->task_clients, i));
- g_ptr_array_free (priv->task_clients, TRUE);
- }
+ if (priv->event_clients) {
+ for (i = 0; i < priv->event_clients->len; i++)
+ g_object_unref (g_ptr_array_index (priv->event_clients, i));
+ g_ptr_array_free (priv->event_clients, TRUE);
+ priv->event_client = NULL;
+ priv->event_clients = NULL;
+ }
- g_free (priv);
+ if (priv->task_clients) {
+ for (i = 0; i < priv->task_clients->len; i++)
+ g_object_unref (g_ptr_array_index (priv->task_clients, i));
+ g_ptr_array_free (priv->task_clients, TRUE);
+ priv->task_client = NULL;
+ priv->task_clients = NULL;
+ }
+
+ g_free (priv);
+ itip->priv = NULL;
+ }
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (obj);