Fix memory leak in mainWindow_checkDate (Resolves #4)
This commit is contained in:
parent
2b2d7d08e3
commit
756e8fa4fd
@ -859,14 +859,17 @@ void mainWindow_checkDate(GtkWidget *widget, gint event, gpointer user_data)
|
|||||||
{
|
{
|
||||||
struct mainWindow *mainWindow = (struct mainWindow *)user_data;
|
struct mainWindow *mainWindow = (struct mainWindow *)user_data;
|
||||||
GDateTime *datetime;
|
GDateTime *datetime;
|
||||||
|
gchar *temp;
|
||||||
|
|
||||||
datetime = mdiary_get_date_from_string((char *)gtk_entry_get_text(GTK_ENTRY(widget)));
|
datetime = mdiary_get_date_from_string((char *)gtk_entry_get_text(GTK_ENTRY(widget)));
|
||||||
if (!datetime) {
|
if (!datetime) {
|
||||||
datetime = g_date_time_new_from_unix_local(widget == mainWindow->dateStart
|
datetime = g_date_time_new_from_unix_local(widget == mainWindow->dateStart
|
||||||
? mainWindow->filterSettings.time_start
|
? mainWindow->filterSettings.time_start
|
||||||
: mainWindow->filterSettings.time_end);
|
: mainWindow->filterSettings.time_end);
|
||||||
|
temp = g_date_time_format(datetime, "%Y-%m-%d");
|
||||||
gtk_entry_set_text(GTK_ENTRY(widget),
|
gtk_entry_set_text(GTK_ENTRY(widget),
|
||||||
g_date_time_format(datetime, "%Y-%m-%d"));
|
temp);
|
||||||
|
g_free(temp);
|
||||||
}
|
}
|
||||||
g_date_time_unref(datetime);
|
g_date_time_unref(datetime);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user