Commit 6a78c3b7504b280daffe662eafebd18567796fdc
1 parent
0e69c430
Exists in
master
and in
2 other branches
Fixing segfault on multiple use of settings dialog.
Showing
3 changed files
with
5 additions
and
2 deletions
Show diff stats
src/include/pw3270/application.h
@@ -65,6 +65,9 @@ | @@ -65,6 +65,9 @@ | ||
65 | GType pw3270Application_get_type(); | 65 | GType pw3270Application_get_type(); |
66 | GtkApplication * pw3270_application_new(const gchar *application_id, GApplicationFlags flags); | 66 | GtkApplication * pw3270_application_new(const gchar *application_id, GApplicationFlags flags); |
67 | 67 | ||
68 | + /// @brief Get application settings. | ||
69 | + /// @param app The pw3270 application object. | ||
70 | + /// @return The internal settings object (Do not unref it). | ||
68 | GSettings * pw3270_application_get_settings(GApplication *app); | 71 | GSettings * pw3270_application_get_settings(GApplication *app); |
69 | GList * pw3270_application_get_keypad_models(GApplication *app); | 72 | GList * pw3270_application_get_keypad_models(GApplication *app); |
70 | 73 |
src/objects/application/application.c
@@ -352,7 +352,7 @@ | @@ -352,7 +352,7 @@ | ||
352 | 352 | ||
353 | G_APPLICATION_CLASS(pw3270Application_parent_class)->startup(application); | 353 | G_APPLICATION_CLASS(pw3270Application_parent_class)->startup(application); |
354 | 354 | ||
355 | - g_autoptr(GSettings) settings = pw3270_application_get_settings(application); | 355 | + GSettings *settings = pw3270_application_get_settings(application); |
356 | 356 | ||
357 | // | 357 | // |
358 | // Common actions | 358 | // Common actions |
src/objects/window/actions/sessionproperties.c
@@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
53 | 53 | ||
54 | size_t ix; | 54 | size_t ix; |
55 | 55 | ||
56 | - g_autoptr(GSettings) settings = pw3270_application_get_settings(g_application_get_default()); | 56 | + GSettings *settings = pw3270_application_get_settings(g_application_get_default()); |
57 | 57 | ||
58 | GtkWidget * dialog = v3270_settings_dialog_new(); | 58 | GtkWidget * dialog = v3270_settings_dialog_new(); |
59 | gtk_window_set_title(GTK_WINDOW(dialog), action->label); | 59 | gtk_window_set_title(GTK_WINDOW(dialog), action->label); |