From 21ff699251f84e5f915188b69f05a4bd64a81920 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Sun, 5 Nov 2023 12:04:49 -0500
Subject: [PATCH] test: Fix popup test crash on exit
If the done signal is emitted by the common event handler, the window and all of its children have already been destroyed, so don't try to render with invalid renderer objects.
---
test/testpopup.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/testpopup.c b/test/testpopup.c
index a8ecabe065bd..9631536ffa16 100644
--- a/test/testpopup.c
+++ b/test/testpopup.c
@@ -188,6 +188,10 @@ static void loop(void)
SDLTest_CommonEvent(state, &event, &done);
}
+ if (done) {
+ return;
+ }
+
/* Show the tooltip if the delay period has elapsed */
if (SDL_GetTicks() > tooltip_timer) {
if (tooltip.win == NULL) {