SF.net SVN: geany:[3358] trunk/src/stash.c

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Dec 11 13:25:08 UTC 2008


Revision: 3358
          http://geany.svn.sourceforge.net/geany/?rev=3358&view=rev
Author:   ntrel
Date:     2008-12-11 13:25:08 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
Add note about not duplicating static arrays passed to Stash.
Don't duplicate default_value argument for string prefs.

Modified Paths:
--------------
    trunk/src/stash.c

Modified: trunk/src/stash.c
===================================================================
--- trunk/src/stash.c	2008-12-11 13:14:33 UTC (rev 3357)
+++ trunk/src/stash.c	2008-12-11 13:25:08 UTC (rev 3358)
@@ -25,7 +25,11 @@
 /* Mini-library for reading/writing GKeyFile settings and synchronizing widgets with
  * C variables. */
 
+/* Memory Usage
+ * Stash will not duplicate strings if they are normally static arrays, such as
+ * keyfile group names and key names. */
 
+
 #include <gtk/gtk.h>
 
 #include "stash.h"
@@ -211,10 +215,11 @@
 }
 
 
+/* @param default_value Not duplicated. */
 void stash_group_add_string(GeanyPrefGroup *group, gchar **setting,
 		const gchar *key_name, const gchar *default_value)
 {
-	add_pref(group, G_TYPE_STRING, setting, key_name, g_strdup(default_value));
+	add_pref(group, G_TYPE_STRING, setting, key_name, (gpointer)default_value);
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list