aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util/calobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/cal-util/calobj.c')
-rw-r--r--calendar/cal-util/calobj.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index cc9c1636c7..9691d31c11 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -66,6 +66,8 @@ ical_object_new (void)
ico->pilot_id = 0;
ico->pilot_status = ICAL_PILOT_SYNC_MOD;
+ ico->ref_count = 1;
+
return ico;
}
@@ -91,6 +93,23 @@ ical_new (char *comment, char *organizer, char *summary)
return ico;
}
+
+void
+ical_object_ref (iCalObject *ico)
+{
+ ico->ref_count++;
+}
+
+
+void
+ical_object_unref (iCalObject *ico)
+{
+ ico->ref_count--;
+ if (ico->ref_count == 0)
+ ical_object_destroy (ico);
+}
+
+
static void
my_free (gpointer data, gpointer user_dat_ignored)
{
@@ -588,6 +607,8 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
return 0;
}
+ ical->ref_count = 1;
+
/* uid */
if (has (o, VCUniqueStringProp)){
ical->uid = g_strdup (str_val (vo));
ff8478c442d745a54e4630671fc'>MASTER_SITES cleanup.mat2015-05-141-1/+0 * Unbreak arirang -- it needs to use the newer Ruby API, which, at themi2015-03-232-9/+26 * Deprecate ports that do not work with Ruby 2.xantoine2015-03-011-0/+2 * Update "BSD" license in security categoryfeld2014-12-101-1/+1 * Cleanup plistantoine2014-11-131-1/+0 * security/arirang: Mark broken with Ruby 2.0 or newerswills2014-07-291-1/+7 * - Ruby 1.8 is gone, switch to USE_RUBY=yesswills2014-01-031-1/+1 * Drop maintainershipbapt2013-12-171-1/+1 * Enable stagebapt2013-10-19