fix: gin_helper::Promise in GPUInfoManager must be destroyed before destroying Node/V8 (#46471)

* fix: gin_helper::Promise in GPUInfoManager must be destroyed before destroying Node/V8

Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>

* fix: use CleanedUpAtExit to control the lifetime of GPUInfoManager

Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Yang Liu <ouyangliu.leo@gmail.com>
This commit is contained in:
trop[bot] 2025-04-03 18:05:13 -05:00 committed by GitHub
parent 30ccda8ba0
commit 8fec7adfa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -17,7 +17,9 @@
namespace electron {
GPUInfoManager* GPUInfoManager::GetInstance() {
return base::Singleton<GPUInfoManager>::get();
// will be deleted by CleanedUpAtExit::DoCleanup
static GPUInfoManager* instance = new GPUInfoManager();
return instance;
}
GPUInfoManager::GPUInfoManager()