mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
gtk/recentmanager: Fix date leak
This commit is contained in:
parent
dc82959ac1
commit
10c62d9e72
@ -1431,6 +1431,7 @@ gtk_recent_manager_clamp_to_age (GtkRecentManager *manager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_strfreev (uris);
|
g_strfreev (uris);
|
||||||
|
g_date_time_unref (now);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2180,13 +2181,16 @@ gtk_recent_info_get_uri_display (GtkRecentInfo *info)
|
|||||||
int
|
int
|
||||||
gtk_recent_info_get_age (GtkRecentInfo *info)
|
gtk_recent_info_get_age (GtkRecentInfo *info)
|
||||||
{
|
{
|
||||||
|
int diff;
|
||||||
GDateTime *now;
|
GDateTime *now;
|
||||||
|
|
||||||
g_return_val_if_fail (info != NULL, -1);
|
g_return_val_if_fail (info != NULL, -1);
|
||||||
|
|
||||||
now = g_date_time_new_now_utc ();
|
now = g_date_time_new_now_utc ();
|
||||||
|
diff = (int) (g_date_time_difference (now, info->modified) / (double)G_TIME_SPAN_DAY);
|
||||||
|
|
||||||
return (int) (g_date_time_difference (now, info->modified) / (double)G_TIME_SPAN_DAY);
|
g_date_time_unref (now);
|
||||||
|
return diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user