fix: crash in gin::wrappable::secondweakcallback (#45378)

fix: crash in gin::wrappable::secondweakcallback (#45368)
This commit is contained in:
Keeley Hammond 2025-01-29 15:04:08 -08:00 committed by GitHub
parent e99328a45e
commit ef1ad85082
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 230 additions and 3 deletions

View file

@ -27,11 +27,14 @@ CleanedUpAtExit::~CleanedUpAtExit() {
std::erase(GetDoomed(), this);
}
void CleanedUpAtExit::WillBeDestroyed() {}
// static
void CleanedUpAtExit::DoCleanup() {
auto& doomed = GetDoomed();
while (!doomed.empty()) {
CleanedUpAtExit* next = doomed.back();
next->WillBeDestroyed();
delete next;
}
}