From 90d1c0b2b6307ca64fff6576e91c2e003889a65b Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Mon, 19 Nov 2018 13:12:41 -0800 Subject: [PATCH] chore: don't explicitly destroy asar archives (#15734) --- atom/common/api/atom_api_asar.cc | 6 +----- lib/common/asar.js | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/atom/common/api/atom_api_asar.cc b/atom/common/api/atom_api_asar.cc index 240b5504c24..d1b85d20856 100644 --- a/atom/common/api/atom_api_asar.cc +++ b/atom/common/api/atom_api_asar.cc @@ -39,8 +39,7 @@ class Archive : public mate::Wrappable { .SetMethod("readdir", &Archive::Readdir) .SetMethod("realpath", &Archive::Realpath) .SetMethod("copyFileOut", &Archive::CopyFileOut) - .SetMethod("getFd", &Archive::GetFD) - .SetMethod("destroy", &Archive::Destroy); + .SetMethod("getFd", &Archive::GetFD); } protected: @@ -113,9 +112,6 @@ class Archive : public mate::Wrappable { return archive_->GetFD(); } - // Free the resources used by archive. - void Destroy() { archive_.reset(); } - private: std::unique_ptr archive_; diff --git a/lib/common/asar.js b/lib/common/asar.js index 451386e904a..eac5213afe2 100644 --- a/lib/common/asar.js +++ b/lib/common/asar.js @@ -37,14 +37,6 @@ return newArchive } - // Clean cache on quit. - process.on('exit', () => { - for (const archive of cachedArchives.values()) { - archive.destroy() - } - cachedArchives.clear() - }) - const ASAR_EXTENSION = '.asar' // Separate asar package's path from full path.