[gnome-builder] egg-task-cache: use g_clear_pointer()



commit e6b93cf22b404490386c8449890377755a33dba7
Author: Christian Hergert <chergert redhat com>
Date:   Mon Mar 6 14:21:13 2017 -0800

    egg-task-cache: use g_clear_pointer()
    
    Just convenient, has extra race defensiveness, and preferred style for
    Builder.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779660

 contrib/egg/egg-task-cache.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/contrib/egg/egg-task-cache.c b/contrib/egg/egg-task-cache.c
index 8b2fa69..8dc8540 100644
--- a/contrib/egg/egg-task-cache.c
+++ b/contrib/egg/egg-task-cache.c
@@ -233,8 +233,7 @@ cancelled_data_free (gpointer data)
 {
   CancelledData *cancelled = data;
 
-  cancelled->self->key_destroy_func (cancelled->key);
-  cancelled->key = NULL;
+  g_clear_pointer (&cancelled->key, cancelled->self->key_destroy_func);
 
   g_cancellable_disconnect (cancelled->cancellable, cancelled->cancelled_id);
   g_clear_object (&cancelled->cancellable);


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