Add a warning against using g_quark_from_static_string() in dynamically

2005-02-03  Matthias Clasen  <mclasen@redhat.com>

	* glib/tmpl/quarks.sgml: Add a warning against
	using g_quark_from_static_string() in dynamically
	loaded modules.
This commit is contained in:
Matthias Clasen 2005-02-03 05:45:21 +00:00 committed by Matthias Clasen
parent 6add23f1b9
commit d2c401d55a
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-02-03 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/quarks.sgml: Add a warning against
using g_quark_from_static_string() in dynamically
loaded modules.
2005-02-02 Matthias Clasen <mclasen@redhat.com> 2005-02-02 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/misc_utils.sgml: * glib/tmpl/misc_utils.sgml:

View File

@ -58,7 +58,11 @@ If the string does not currently have an associated #GQuark, a new
Note that this function is identical to g_quark_from_string() except Note that this function is identical to g_quark_from_string() except
that if a new #GQuark is created the string itself is used rather than that if a new #GQuark is created the string itself is used rather than
a copy. This saves memory, but can only be used if the string will a copy. This saves memory, but can only be used if the string will
always exist (if, for example, it is a statically-allocated string). <emphasis>always</emphasis> exist. It can be used with statically
allocated strings in the main program, but not with statically
allocated memory in dynamically loaded modules, if you expect to
ever unload the module again (e.g. do not use this function in
GTK+ theme engines).
</para> </para>
@string: a string. @string: a string.