Fixes for various leaks causing memory build-ups in eds.
authorHarish Krishnamwamy <kharish@novell.com>
Thu, 9 Dec 2004 07:00:44 +0000 (07:00 +0000)
committerHarish Krishnaswamy <kharish@src.gnome.org>
Thu, 9 Dec 2004 07:00:44 +0000 (07:00 +0000)
2004-12-09  Harish Krishnamwamy <kharish@novell.com>
Fixes for various leaks causing memory build-ups in eds.

* libecal/e-cal-listener.c (impl_notifyFreeBusy):
l->data should be unref'd - not free'd.
* libedata-cal/e-cal-backend.c
* (get_queries):
Do not ref the queries while returning them. This is unnecessary.
* libedata-cal/e-cal-backend-sexp.c
* (e_cal_backend_sexp_match_comp):
unref the comp and backend while returning.

calendar/ChangeLog
calendar/libecal/e-cal-listener.c
calendar/libecal/e-cal.c
calendar/libedata-cal/e-cal-backend-sexp.c
calendar/libedata-cal/e-cal-backend.c

index 314adc9..072f31d 100644 (file)
@@ -1,3 +1,14 @@
+2004-12-09  Harish Krishnamwamy <kharish@novell.com>
+       Fixes for various leaks causing memory build-ups in eds.
+       
+       * libecal/e-cal-listener.c (impl_notifyFreeBusy):
+       l->data should be unref'd - not free'd.
+       * libedata-cal/e-cal-backend.c (get_queries):
+       Do not ref the queries while returning them. This is unnecessary.
+       * libedata-cal/e-cal-backend-sexp.c (e_cal_backend_sexp_match_comp) :
+       unref the comp and backend while returning.
+       
+       
 2004-12-06  Harish Krishnaswamy <kharish@novell.com> 
        * backends/groupwise/e-cal-backend-groupwise-utils.c 
        (e_gw_connection_send_appointment) : Add correct view arguments 
index 87ac2ee..15225fd 100644 (file)
@@ -584,7 +584,7 @@ impl_notifyFreeBusy (PortableServer_Servant servant,
        g_signal_emit (G_OBJECT (listener), signals[GET_FREE_BUSY], 0, convert_status (status), freebusy);
 
        for (l = freebusy; l; l = l->next)
-               g_free (l->data);
+               g_object_unref (G_OBJECT (l->data));
        g_list_free (freebusy);
 }
 
index 20288b5..c3893a3 100644 (file)
@@ -2581,7 +2581,6 @@ e_cal_get_objects_for_uid (ECal *ecal, const char *uid, GList **objects, GError
                                        comp = e_cal_component_new ();
                                        e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (subcomp));
                                        *objects = g_list_append (*objects, comp);
-
                                        subcomp = icalcomponent_get_next_component (icalcomp, kind_to_find);
                                }
                        }
@@ -3030,7 +3029,7 @@ static void
 generate_instances (ECal *ecal, time_t start, time_t end, const char *uid,
                    ECalRecurInstanceFn cb, gpointer cb_data)
 {
-       GList *objects;
+       GList *objects = NULL;
        GList *instances, *detached_instances = NULL;
        GList *l;
        char *query;
index 79fc483..7187a4c 100644 (file)
@@ -981,9 +981,11 @@ e_cal_backend_sexp_match_comp (ECalBackendSExp *sexp, ECalComponent *comp, ECalB
        sexp->priv->search_context->backend = g_object_ref (backend);
 
        /* if it's not a valid vcard why is it in our db? :) */
-       if (!sexp->priv->search_context->comp)
+       if (!sexp->priv->search_context->comp)  {
+               g_object_unref (sexp->priv->search_context->comp);
+               g_object_unref (sexp->priv->search_context->backend);
                return FALSE;
-
+       }
        r = e_sexp_eval(sexp->priv->search_sexp);
 
        retval = (r && r->type == ESEXP_RES_BOOL && r->value.bool);
index 4ea3212..799d7a5 100644 (file)
@@ -502,7 +502,7 @@ e_cal_backend_get_queries (ECalBackend *backend)
        g_return_val_if_fail (backend != NULL, NULL);
        g_return_val_if_fail (E_IS_CAL_BACKEND (backend), NULL);
 
-       return g_object_ref (backend->priv->queries);
+       return backend->priv->queries;
 }