Replace static privates by privates

GStaticPrivate is heading for deprecation soon, and GPrivate
can replace these uses now.
This commit is contained in:
Matthias Clasen
2011-10-02 21:57:40 -04:00
parent 6f71151823
commit 34ce4dd032
3 changed files with 14 additions and 14 deletions

View File

@@ -581,20 +581,20 @@ charset_cache_free (gpointer data)
*
* The string returned in @charset is not allocated, and should not be
* freed.
*
*
* Return value: %TRUE if the returned charset is UTF-8
**/
gboolean
g_get_charset (const char **charset)
g_get_charset (const char **charset)
{
static GStaticPrivate cache_private = G_STATIC_PRIVATE_INIT;
GCharsetCache *cache = g_static_private_get (&cache_private);
static GPrivate cache_private = G_PRIVATE_INIT (charset_cache_free);
GCharsetCache *cache = g_private_get (&cache_private);
const gchar *raw;
if (!cache)
{
cache = g_new0 (GCharsetCache, 1);
g_static_private_set (&cache_private, cache, charset_cache_free);
g_private_set (&cache_private, cache);
}
G_LOCK (aliases);