diff options
author | Simon McVittie <smcv@collabora.com> | 2021-04-15 19:23:47 +0100 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2021-04-16 09:13:18 +0200 |
commit | a89aa1442a7cb4f151b63c68cf64172bb4c29798 (patch) | |
tree | 2bc199b8f9c6ac1f0bd4f0a6bb2c72713937f6ef | |
parent | cb47d83b7221de7f08a487dd47e69eec57f458e5 (diff) | |
download | flatpak-a89aa1442a7cb4f151b63c68cf64172bb4c29798.tar.gz |
run: Delay allocation of per-app directory
If we call this after flatpak_run_add_app_info_args(), then the
garbage-collection code will have a chance to run, cleaning up after a
previous instance of the same app.
In a previous implementation of #4093 that also implemented #4120, we
had to allocate the per-app directory this early to avoid shadowing the
XDG_RUNTIME_DIR allocated in flatpak_run_add_app_info_args(), but I'm
taking a different approach to that now.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | common/flatpak-run.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/common/flatpak-run.c b/common/flatpak-run.c index 52fd9854..ef498e90 100644 --- a/common/flatpak-run.c +++ b/common/flatpak-run.c @@ -4220,15 +4220,6 @@ flatpak_run_app (FlatpakDecomposed *app_ref, flags |= flatpak_context_get_run_flags (app_context); - if (!sandboxed) - { - if (!flatpak_instance_ensure_per_app_dir (app_id, - &per_app_dir_lock_fd, - &per_app_dir_lock_path, - error)) - return FALSE; - } - if (!flatpak_run_setup_base_argv (bwrap, runtime_files, app_id_dir, app_arch, flags, error)) return FALSE; @@ -4256,6 +4247,15 @@ flatpak_run_app (FlatpakDecomposed *app_ref, error)) return FALSE; + if (!sandboxed) + { + if (!flatpak_instance_ensure_per_app_dir (app_id, + &per_app_dir_lock_fd, + &per_app_dir_lock_path, + error)) + return FALSE; + } + if (!flatpak_run_add_dconf_args (bwrap, app_id, metakey, error)) return FALSE; |