From ab660be49fa802fe9de1cb2360480bc01439a73f Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Thu, 30 May 2024 10:04:03 +0800 Subject: [PATCH] common/prefix.h: Fix incomplete path cleanup on exit (#32559) old-commit-hash: 5f778c0d3a740b271d10b10842406a97bd27d959 --- common/prefix.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/prefix.h b/common/prefix.h index f5abe14b2b..11d0bc1066 100644 --- a/common/prefix.h +++ b/common/prefix.h @@ -5,6 +5,7 @@ #include "common/params.h" #include "common/util.h" +#include "system/hardware/hw.h" class OpenpilotPrefix { public: @@ -25,6 +26,10 @@ public: system(util::string_format("rm %s -rf", real_path.c_str()).c_str()); unlink(param_path.c_str()); } + if (getenv("COMMA_CACHE") == nullptr) { + system(util::string_format("rm %s -rf", Path::download_cache_root().c_str()).c_str()); + } + system(util::string_format("rm %s -rf", Path::comma_home().c_str()).c_str()); system(util::string_format("rm %s -rf", msgq_path.c_str()).c_str()); unsetenv("OPENPILOT_PREFIX"); }