Stop using memory I don't own. Thanks Alberto Mardegan.
[tweakr] / maemo-tweaks.c
index af03341..1fbff09 100644 (file)
@@ -66,14 +66,18 @@ osso_return_t execute (osso_context_t *osso, gpointer data,
     response = gtk_dialog_run (GTK_DIALOG (dialog));
     if (response == GTK_RESPONSE_OK)
     {
+        /* Save all settings */
+        g_list_foreach (sections, (GFunc) maemo_tweaks_section_save, NULL);
     }
 
 
     gtk_widget_destroy (GTK_WIDGET (dialog));
     g_object_unref (manager);
-    g_list_foreach (sections, (GFunc) g_object_unref, NULL);
     if (sections)
+    {
+        g_list_foreach (sections, (GFunc) g_object_unref, NULL);
         g_list_free (sections);
+    }
 
     return OSSO_OK;
 }