diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-04-21 21:32:49 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-04-22 08:55:41 +0200 |
commit | 4261057e2a0531db759b0e29292b352ae2f43634 (patch) | |
tree | 3ecc8970ce968e524e5a33d9f4ba2f8761139070 /common | |
parent | 7d509ab93a83a9d6662ee201f3657e2f584b7eda (diff) | |
download | xdg-app-4261057e2a0531db759b0e29292b352ae2f43634.tar.gz |
common: Don't use singletons for the system/user XdgAppDirs
Without this we never finalize them and can't e.g. remote temporary
files.
Diffstat (limited to 'common')
-rw-r--r-- | common/xdg-app-dir.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/common/xdg-app-dir.c b/common/xdg-app-dir.c index 05d7f87..d6704ae 100644 --- a/common/xdg-app-dir.c +++ b/common/xdg-app-dir.c @@ -2934,29 +2934,15 @@ xdg_app_dir_clone (XdgAppDir *self) XdgAppDir * xdg_app_dir_get_system (void) { - static XdgAppDir *system = NULL; - - if (system == NULL) - { - g_autoptr(GFile) path = xdg_app_get_system_base_dir_location (); - system = xdg_app_dir_new (path, FALSE); - } - - return g_object_ref (system); + g_autoptr(GFile) path = xdg_app_get_system_base_dir_location (); + return xdg_app_dir_new (path, FALSE); } XdgAppDir * xdg_app_dir_get_user (void) { - static XdgAppDir *user = NULL; - - if (user == NULL) - { - g_autoptr(GFile) path = xdg_app_get_user_base_dir_location (); - user = xdg_app_dir_new (path, TRUE); - } - - return g_object_ref (user); + g_autoptr(GFile) path = xdg_app_get_user_base_dir_location (); + return xdg_app_dir_new (path, TRUE); } XdgAppDir * |