[evolution-data-server/wip/mcrha/libical-glib] Correct more issues found during testing



commit 59c12ae51d98920138b84b7f7ed1adbeca53904a
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jan 31 13:57:51 2019 +0100

    Correct more issues found during testing

 src/calendar/libecal/e-cal-component-alarm-trigger.c |  8 +++++---
 src/calendar/libecal/e-cal-component.c               | 12 +++++++-----
 src/calendar/libecal/e-cal-component.h               |  4 ++--
 3 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/calendar/libecal/e-cal-component-alarm-trigger.c 
b/src/calendar/libecal/e-cal-component-alarm-trigger.c
index 9172b5f41..31b1aac9b 100644
--- a/src/calendar/libecal/e-cal-component-alarm-trigger.c
+++ b/src/calendar/libecal/e-cal-component-alarm-trigger.c
@@ -332,13 +332,15 @@ e_cal_component_alarm_trigger_fill_property (const ECalComponentAlarmTrigger *tr
                i_cal_trigger_type_set_time (trgtype, trigger->abs_time);
                value_type = I_CAL_VALUE_DATETIME;
                break;
-
-       default:
-               g_return_if_reached ();
+       case E_CAL_COMPONENT_ALARM_TRIGGER_NONE:
+               g_object_unref (trgtype);
+               return;
        }
 
        i_cal_property_set_trigger (property, trgtype);
 
+       g_object_unref (trgtype);
+
        param = i_cal_property_get_first_parameter (property, I_CAL_VALUE_PARAMETER);
        if (param) {
                i_cal_parameter_set_value (param, value_type);
diff --git a/src/calendar/libecal/e-cal-component.c b/src/calendar/libecal/e-cal-component.c
index 6b2abf531..2780d9d07 100644
--- a/src/calendar/libecal/e-cal-component.c
+++ b/src/calendar/libecal/e-cal-component.c
@@ -110,13 +110,18 @@ foreach_subcomponent (ICalComponent *icalcomp,
        iter = i_cal_component_begin_component (icalcomp, comp_kind);
        subcomp = i_cal_comp_iter_deref (iter);
        while (subcomp) {
+               ICalComponent *next_subcomp;
+
+               next_subcomp = i_cal_comp_iter_next (iter);
+
                if (!func (icalcomp, subcomp, user_data)) {
+                       g_clear_object (&next_subcomp);
                        g_object_unref (subcomp);
                        break;
                }
 
                g_object_unref (subcomp);
-               subcomp = i_cal_comp_iter_next (iter);
+               subcomp = next_subcomp;
        }
 
        g_clear_object (&iter);
@@ -702,12 +707,10 @@ ensure_alarm_properties_cb (ICalComponent *icalcomp,
                                                break;
                                        }
                                }
-
-                               g_object_unref (prop);
-                               break;
                        }
 
                        g_object_unref (prop);
+                       break;
                }
 
                if (!summary || !*summary) {
@@ -4261,7 +4264,6 @@ e_cal_component_event_dates_match (ECalComponent *comp1,
        }
 
  out:
-
        e_cal_component_datetime_free (comp1_dtstart);
        e_cal_component_datetime_free (comp1_dtend);
        e_cal_component_datetime_free (comp2_dtstart);
diff --git a/src/calendar/libecal/e-cal-component.h b/src/calendar/libecal/e-cal-component.h
index 80fd5df5a..95d24ca16 100644
--- a/src/calendar/libecal/e-cal-component.h
+++ b/src/calendar/libecal/e-cal-component.h
@@ -278,11 +278,11 @@ void              e_cal_component_remove_alarm    (ECalComponent *comp,
 void           e_cal_component_remove_all_alarms
                                                (ECalComponent *comp);
 
-GSList *       e_cal_component_get_alarm_uids  (ECalComponent *comp);
+GSList *       e_cal_component_get_alarm_uids  (ECalComponent *comp); /* gchar * */
 ECalComponentAlarm *
                e_cal_component_get_alarm       (ECalComponent *comp,
                                                 const gchar *auid);
-GSList *       e_cal_component_get_all_alarms  (ECalComponent *comp);
+GSList *       e_cal_component_get_all_alarms  (ECalComponent *comp); /* ECalComponentAlarm * */
 
 gboolean       e_cal_component_event_dates_match
                                                (ECalComponent *comp1,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]