diff options
author | culler <culler> | 2021-06-04 18:42:26 (GMT) |
---|---|---|
committer | culler <culler> | 2021-06-04 18:42:26 (GMT) |
commit | 6380f833c39317057defb9d41f32707be9ff9ef4 (patch) | |
tree | 57570a140031e5ffdd2cf9633e9ea755110fc147 | |
parent | 4b6536fe00cccdbee717f125f0da5ec5393a3926 (diff) | |
parent | 72a980f72faa8a7136dc3d695877e7e42840bd16 (diff) | |
download | tk-6380f833c39317057defb9d41f32707be9ff9ef4.zip tk-6380f833c39317057defb9d41f32707be9ff9ef4.tar.gz tk-6380f833c39317057defb9d41f32707be9ff9ef4.tar.bz2 |
Fix [099109cf1f]: segfault when destroying an embedded window if the container has multiple embedded windows
-rw-r--r-- | macosx/tkMacOSXEmbed.c | 3 | ||||
-rw-r--r-- | unix/tkUnixEmbed.c | 1 | ||||
-rw-r--r-- | win/tkWinEmbed.c | 2 |
3 files changed, 5 insertions, 1 deletions
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. 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; |