diff options
author | Darin Adler <darin@src.gnome.org> | 2000-09-25 20:10:17 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2000-09-25 20:10:17 +0000 |
commit | 2a0db776871eb248e7ec10144a4d8b379528d79d (patch) | |
tree | 7710978dbdaad50aa9cdc32168acb8a01c740fc6 /libnautilus-private/nautilus-theme.c | |
parent | 5513ac152806b32321331a6d7b3eac66cd8c15a6 (diff) | |
download | nautilus-2a0db776871eb248e7ec10144a4d8b379528d79d.tar.gz |
Fix double-free problem that was causing a crash on quit if you changed
* libnautilus-extensions/nautilus-theme.c: (load_theme_document),
(nautilus_theme_get_theme_data): Fix double-free problem that was
causing a crash on quit if you changed themes.
Diffstat (limited to 'libnautilus-private/nautilus-theme.c')
-rw-r--r-- | libnautilus-private/nautilus-theme.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-theme.c b/libnautilus-private/nautilus-theme.c index b20845e3c..5fe3b7070 100644 --- a/libnautilus-private/nautilus-theme.c +++ b/libnautilus-private/nautilus-theme.c @@ -79,7 +79,7 @@ load_theme_document (const char * theme_name) char *theme_path, *temp_str; /* formulate the theme path name */ - if (strcmp(theme_name, "default") == 0) { + if (strcmp (theme_name, "default") == 0) { theme_path = nautilus_pixmap_file ("default.xml"); } else { temp_str = g_strdup_printf("%s/%s.xml", theme_name, theme_name); @@ -114,6 +114,7 @@ nautilus_theme_get_theme_data (const char *resource_name, const char *property_n { char *theme_name, *temp_str; char *theme_data; + static gboolean did_set_up_free_last_theme; xmlDocPtr theme_document; xmlNodePtr resource_node; @@ -126,12 +127,15 @@ nautilus_theme_get_theme_data (const char *resource_name, const char *property_n theme_document = last_theme_document; } else { /* release the old saved data, since the theme changed */ + if (!did_set_up_free_last_theme) { + g_atexit (free_last_theme); + did_set_up_free_last_theme = TRUE; + } free_last_theme (); last_theme_name = g_strdup (theme_name); last_theme_document = load_theme_document (theme_name); theme_document = last_theme_document; - g_atexit (free_last_theme); } if (theme_document != NULL) { |