Skip to content

Commit 754c5b2

Browse files
committed
g_date_time_unref only ath the end of the iteration and if not NULL
1 parent 4d67190 commit 754c5b2

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

remmina/src/remmina_stats.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -584,17 +584,11 @@ static void remmina_profiles_get_data(RemminaFile *remminafile, gpointer user_da
584584
//remmina_log_printf("Date %s is newer than the one inside pdata->protocol for protocol %s\n", g_strdup(pdata->pdatestr), g_strdup(pdata->protocol));
585585
g_hash_table_replace(pdata->proto_date, g_strdup(pdata->protocol), g_strdup(pdata->pdatestr));
586586
}
587-
g_date_time_unref(ds);
588-
}
589-
/** If the date in the hash is valid and the date in the profile is NULL we keep the first one */
590-
if (ds && !dd) {
591-
g_date_time_unref(ds);
592587
}
593588
/** If the date in the hash is NOT valid and the date in the profile is valid we keep the latter */
594589
if (!ds && dd) {
595590
//remmina_log_printf("Date %s inserted in pdata->protocol for protocol %s\n", g_strdup(pdata->pdatestr), g_strdup(pdata->protocol));
596591
g_hash_table_replace(pdata->proto_date, g_strdup(pdata->protocol), g_strdup(pdata->pdatestr));
597-
g_date_time_unref(ds);
598592
}
599593
/** If both date are NULL, we insert NULL for that protocol */
600594
if ((!ds && !dd) && pdata->pdatestr) {
@@ -613,9 +607,11 @@ static void remmina_profiles_get_data(RemminaFile *remminafile, gpointer user_da
613607
g_hash_table_replace(pdata->proto_date, g_strdup(pdata->protocol), NULL);
614608
}
615609
}
616-
if (dd)
617-
g_date_time_unref(dd);
618610
}
611+
if (dd)
612+
g_date_time_unref(dd);
613+
if (ds)
614+
g_date_time_unref(ds);
619615
}
620616

621617
/**

remmina/ui/remmina_main.glade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- Generated with glade 3.20.2
2+
<!-- Generated with glade 3.20.0
33
44
Remmina - The GTK+ Remmina Remote Desktop Client
5-
Copyright (C) Antenore Gatta & Giovanni Panozzo 2014-2017
5+
Copyright (C) Antenore Gatta & Giovanni Panozzo 2014-2018
66
77
This program is free software; you can redistribute it and/or
88
modify it under the terms of the GNU General Public License
@@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2424
<!-- interface-license-type gplv2 -->
2525
<!-- interface-name Remmina -->
2626
<!-- interface-description The GTK+ Remmina Remote Desktop Client -->
27-
<!-- interface-copyright Antenore Gatta & Giovanni Panozzo 2014-2017 -->
27+
<!-- interface-copyright Antenore Gatta & Giovanni Panozzo 2014-2018 -->
2828
<object class="GtkAccelGroup" id="accelgroup_shortcuts"/>
2929
<object class="GtkActionGroup" id="actiongroup_application">
3030
<property name="accel_group">accelgroup_shortcuts</property>

0 commit comments

Comments
 (0)