Defer texture destruction in ImguiBridge to prevent use-after-free.

PiperOrigin-RevId: 935327326
Change-Id: I12a148b71abbe50581c7977a1f6dc5e220c40e81
This commit is contained in:
Yuval Tassa
2026-06-20 09:46:12 -07:00
committed by Copybara-Service
parent 9ac0b283dc
commit 2cacf17071
+1 -1
View File
@@ -203,7 +203,7 @@ void ImguiBridge::Update() {
} else if (tex->Status == ImTextureStatus_WantUpdates) {
UpdateTexture(tex);
} else if (tex->Status == ImTextureStatus_WantDestroy &&
tex->UnusedFrames > 0) {
tex->UnusedFrames >= 3) {
DestroyTexture(tex);
}
}