[gnome-control-center] user-accounts: Don't leak DateTime instances



commit 16cd01b3045b3073442bc652f45b1e67c99cfe2d
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Apr 29 14:00:00 2014 +0200

    user-accounts: Don't leak DateTime instances
    
    Before, we were freeing the DateTime instances when closing the dialog
    through the close button and always creating new ones on _show().
    
    Now, with the header bar, we go through the delete-event handler which
    just hides the dialog, meaning that we leak the dates instanced on
    _show().
    
    Clearing the dates on _show() is more robust anyway. Note that we'd
    leak even before switching to a header bar when going through the
    delete-event handler.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729181

 panels/user-accounts/um-history-dialog.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/panels/user-accounts/um-history-dialog.c b/panels/user-accounts/um-history-dialog.c
index fe753a6..8f20fd3 100644
--- a/panels/user-accounts/um-history-dialog.c
+++ b/panels/user-accounts/um-history-dialog.c
@@ -305,6 +305,11 @@ um_history_dialog_show (UmHistoryDialog *um,
 {
         GDateTime *temp, *local;
 
+        if (um->week)
+                g_date_time_unref (um->week);
+        if (um->current_week)
+                g_date_time_unref (um->current_week);
+
         /* Set the first day of this week */
         local = g_date_time_new_now_local ();
         temp = g_date_time_new_local (g_date_time_get_year (local),


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