Fixed grave memory handling bug

This commit is contained in:
Markus Koch 2017-02-19 13:31:11 +01:00
parent faa2ff5612
commit 54a7372abf

View File

@ -26,18 +26,18 @@ const GActionEntry app_actions[] = {
static void activate(GApplication *app, gpointer user_data)
{
struct mainWindow *mainWindow = *((struct mainWindow **) user_data);
struct mainWindow **mainWindow = (struct mainWindow **) user_data;
struct mdiary_settings *settings;
gchar *settings_path;
mainWindow = mainWindow_new();
gtk_application_add_window(GTK_APPLICATION(app), GTK_WINDOW(mainWindow->mainWindow));
*mainWindow = mainWindow_new();
gtk_application_add_window(GTK_APPLICATION(app), GTK_WINDOW((*mainWindow)->mainWindow));
settings_path = g_strdup_printf("%s/.mdiary.conf", g_get_home_dir());
settings = mdiary_settings_new(mainWindow);
settings = mdiary_settings_new(*mainWindow);
mdiary_load_settings(settings_path, settings);
gtk_widget_show(mainWindow->mainWindow);
gtk_widget_show((*mainWindow)->mainWindow);
mdiary_save_settings(settings_path, settings);
mdiary_settings_free(settings);