[evolution-data-server/gnome-40] ECalBackendFile: Free interval tree only when being allocated



commit f560803de9b108dfcf08d62d0397d632b95983ab
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jun 16 15:57:35 2021 +0200

    ECalBackendFile: Free interval tree only when being allocated
    
    The free_calendar_data() is called from a dispose() function, which
    can be called several times, thus make sure the e_intervaltree_destroy()
    is called only if the interval tree is still a non-NULL pointer.

 src/calendar/backends/file/e-cal-backend-file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/calendar/backends/file/e-cal-backend-file.c b/src/calendar/backends/file/e-cal-backend-file.c
index 617ac2975..dee072a89 100644
--- a/src/calendar/backends/file/e-cal-backend-file.c
+++ b/src/calendar/backends/file/e-cal-backend-file.c
@@ -298,7 +298,8 @@ free_calendar_data (ECalBackendFile *cbfile)
 
        g_rec_mutex_lock (&priv->idle_save_rmutex);
 
-       e_intervaltree_destroy (priv->interval_tree);
+       if (priv->interval_tree)
+               e_intervaltree_destroy (priv->interval_tree);
        priv->interval_tree = NULL;
 
        free_calendar_components (priv->comp_uid_hash, priv->vcalendar);


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