diff options
author | Christian Persch <chpe@src.gnome.org> | 2008-06-07 20:40:20 +0000 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2008-06-07 20:40:20 +0000 |
commit | dcc94280362d27cb980bfb8e5a3b1db40874a027 (patch) | |
tree | 5605939127d36993c90f7e3840b039521d5b4981 /gtk/gtkaccelmap.c | |
parent | e2642ac9d2d4652e7583ff8962896c6b9dd3ac5f (diff) | |
download | gtk+-dcc94280362d27cb980bfb8e5a3b1db40874a027.tar.gz |
Bug 535608 – do not string-copy accel paths in the menu code
Don't store the accel path as a string in gtkmenu/gtkmenuitem.
The accel path will be interned anyway, so keeping a string copy around
is just a waste of memory.
Improve the documentation to mention this.
svn path=/trunk/; revision=20331
Diffstat (limited to 'gtk/gtkaccelmap.c')
-rw-r--r-- | gtk/gtkaccelmap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gtk/gtkaccelmap.c b/gtk/gtkaccelmap.c index 4756035ae2..c193baaaf8 100644 --- a/gtk/gtkaccelmap.c +++ b/gtk/gtkaccelmap.c @@ -149,6 +149,10 @@ _gtk_accel_path_is_valid (const gchar *accel_path) * e.g. "File/Save As", "Image/View/Zoom" or "Edit/Select All". * So a full valid accelerator path may look like: * "<Gimp-Toolbox>/File/Dialogs/Tool Options...". + * + * Note that @accel_path string will be stored in a #GQuark. Therefore, if you + * pass a static string, you can save some memory by interning it first with + * g_intern_static_string(). */ void gtk_accel_map_add_entry (const gchar *accel_path, @@ -429,6 +433,10 @@ internal_change_entry (const gchar *accel_path, * conflicts. A change will only occur if all conflicts could be resolved (which * might not be the case if conflicting accelerators are locked). Successful * changes are indicated by a %TRUE return value. + * + * Note that @accel_path string will be stored in a #GQuark. Therefore, if you + * pass a static string, you can save some memory by interning it first with + * g_intern_static_string(). */ gboolean gtk_accel_map_change_entry (const gchar *accel_path, |