From 03f9d27042389b6edb846a769b312f7b596c80a8 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 3 Jun 2021 23:12:24 +0000 Subject: Fix [099109cf1f]: crash when destroying an embedded window if the container has multiple embedded windows -- this commit uses Christopher Chavez's patch for Aqua only. --- macosx/tkMacOSXEmbed.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 4af2e75..2f04e74 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -1116,6 +1116,9 @@ EmbedWindowDeleted( prevPtr = NULL; containerPtr = firstContainerPtr; while (1) { + if (containerPtr == NULL) { + return; + } if (containerPtr->embeddedPtr == winPtr) { /* * We also have to destroy our parent, to clean up the container. -- cgit v0.12 From 72a980f72faa8a7136dc3d695877e7e42840bd16 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 4 Jun 2021 14:47:44 +0000 Subject: Analogous changes for linux and Windows --- unix/tkUnixEmbed.c | 1 + win/tkWinEmbed.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c index a33a623..ff7860b 100644 --- a/unix/tkUnixEmbed.c +++ b/unix/tkUnixEmbed.c @@ -979,6 +979,7 @@ EmbedWindowDeleted( prevPtr = NULL; containerPtr = tsdPtr->firstContainerPtr; while (1) { + if (containerPtr == NULL) return; if (containerPtr->embeddedPtr == winPtr) { containerPtr->wrapper = None; containerPtr->embeddedPtr = NULL; diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 1c6ba6c..36c6047 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -1088,8 +1088,8 @@ EmbedWindowDeleted( prevPtr = NULL; containerPtr = tsdPtr->firstContainerPtr; - if (containerPtr == NULL) return; while (1) { + if (containerPtr == NULL) return; if (containerPtr->embeddedPtr == winPtr) { containerPtr->embeddedHWnd = NULL; containerPtr->embeddedPtr = NULL; -- cgit v0.12