summaryrefslogtreecommitdiff
path: root/pango/pango-utils.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2012-09-14 18:37:06 -0400
committerMatthias Clasen <mclasen@redhat.com>2012-09-14 18:37:06 -0400
commitabd17535c26f9675a162dc26412cea0384cdeebd (patch)
treef177580fd0ef2eb8621d64b3f262acce07e304ce /pango/pango-utils.c
parent2fcf11d206a0590e348339ad87cf880b75968607 (diff)
downloadpango-abd17535c26f9675a162dc26412cea0384cdeebd.tar.gz
Load config file only once
Diffstat (limited to 'pango/pango-utils.c')
-rw-r--r--pango/pango-utils.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 4aed1c4f..2595e341 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -522,6 +522,7 @@ pango_scan_int (const char **pos, int *out)
}
static GHashTable *config_hash = NULL;
+static gboolean did_read_system_config = FALSE;
static gboolean did_read_user_config = FALSE;
static void
@@ -608,13 +609,18 @@ read_config_system (void)
{
char *filename;
- ensure_config_hash ();
+ if (!did_read_system_config)
+ {
+ did_read_system_config = TRUE;
+
+ ensure_config_hash ();
- filename = g_build_filename (pango_get_sysconf_subdirectory (),
- "pangorc",
- NULL);
- read_config_file (filename, FALSE, config_hash);
- g_free (filename);
+ filename = g_build_filename (pango_get_sysconf_subdirectory (),
+ "pangorc",
+ NULL);
+ read_config_file (filename, FALSE, config_hash);
+ g_free (filename);
+ }
}
static void