chore: don't explicitly destroy asar archives (#15734)
This commit is contained in:
parent
ec4212cce1
commit
90d1c0b2b6
2 changed files with 1 additions and 13 deletions
|
@ -39,8 +39,7 @@ class Archive : public mate::Wrappable<Archive> {
|
||||||
.SetMethod("readdir", &Archive::Readdir)
|
.SetMethod("readdir", &Archive::Readdir)
|
||||||
.SetMethod("realpath", &Archive::Realpath)
|
.SetMethod("realpath", &Archive::Realpath)
|
||||||
.SetMethod("copyFileOut", &Archive::CopyFileOut)
|
.SetMethod("copyFileOut", &Archive::CopyFileOut)
|
||||||
.SetMethod("getFd", &Archive::GetFD)
|
.SetMethod("getFd", &Archive::GetFD);
|
||||||
.SetMethod("destroy", &Archive::Destroy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -113,9 +112,6 @@ class Archive : public mate::Wrappable<Archive> {
|
||||||
return archive_->GetFD();
|
return archive_->GetFD();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the resources used by archive.
|
|
||||||
void Destroy() { archive_.reset(); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<asar::Archive> archive_;
|
std::unique_ptr<asar::Archive> archive_;
|
||||||
|
|
||||||
|
|
|
@ -37,14 +37,6 @@
|
||||||
return newArchive
|
return newArchive
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean cache on quit.
|
|
||||||
process.on('exit', () => {
|
|
||||||
for (const archive of cachedArchives.values()) {
|
|
||||||
archive.destroy()
|
|
||||||
}
|
|
||||||
cachedArchives.clear()
|
|
||||||
})
|
|
||||||
|
|
||||||
const ASAR_EXTENSION = '.asar'
|
const ASAR_EXTENSION = '.asar'
|
||||||
|
|
||||||
// Separate asar package's path from full path.
|
// Separate asar package's path from full path.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue