Fixed grave memory handling bug
This commit is contained in:
parent
faa2ff5612
commit
54a7372abf
10
src/main.c
10
src/main.c
@ -26,18 +26,18 @@ const GActionEntry app_actions[] = {
|
|||||||
|
|
||||||
static void activate(GApplication *app, gpointer user_data)
|
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;
|
struct mdiary_settings *settings;
|
||||||
gchar *settings_path;
|
gchar *settings_path;
|
||||||
|
|
||||||
mainWindow = mainWindow_new();
|
*mainWindow = mainWindow_new();
|
||||||
gtk_application_add_window(GTK_APPLICATION(app), GTK_WINDOW(mainWindow->mainWindow));
|
gtk_application_add_window(GTK_APPLICATION(app), GTK_WINDOW((*mainWindow)->mainWindow));
|
||||||
|
|
||||||
settings_path = g_strdup_printf("%s/.mdiary.conf", g_get_home_dir());
|
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);
|
mdiary_load_settings(settings_path, settings);
|
||||||
|
|
||||||
gtk_widget_show(mainWindow->mainWindow);
|
gtk_widget_show((*mainWindow)->mainWindow);
|
||||||
|
|
||||||
mdiary_save_settings(settings_path, settings);
|
mdiary_save_settings(settings_path, settings);
|
||||||
mdiary_settings_free(settings);
|
mdiary_settings_free(settings);
|
||||||
|
Loading…
Reference in New Issue
Block a user