Skip to content

Commit 0209fbb

Browse files
author
jan.nijtmans
committed
Don't protect TkFinalize() with SEH on arm64 and in debug more. See [44b34c6152]
2 parents e20bfc0 + e611915 commit 0209fbb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

win/tkWin32Dll.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "tkWinInt.h"
1313
#ifndef STATIC_BUILD
1414

15-
#if defined(HAVE_NO_SEH) && !defined(__aarch64__)
15+
#if defined(HAVE_NO_SEH) && !defined(__aarch64__) && defined(NDEBUG)
1616

1717
/*
1818
* Unlike Borland and Microsoft, we don't register exception handlers by
@@ -101,7 +101,7 @@ DllMain(
101101
DWORD reason,
102102
LPVOID reserved)
103103
{
104-
#if defined(HAVE_NO_SEH) && !defined(__aarch64__)
104+
#if defined(HAVE_NO_SEH) && !defined(__aarch64__) && defined(NDEBUG)
105105
TCLEXCEPTION_REGISTRATION registration;
106106
#endif
107107
(void)reserved;
@@ -123,9 +123,9 @@ DllMain(
123123
* guaranteed Tk is always being unloaded from a stable condition.
124124
*/
125125

126-
#ifdef HAVE_NO_SEH
127-
# if defined(__aarch64__)
128-
/* Don't run TkFinalize(NULL) on mingw-w64 for ARM64, since we don't have corresponding assembler-code. */
126+
#if defined(HAVE_NO_SEH) || defined(__aarch64__) || !defined(NDEBUG)
127+
# if defined(__aarch64__) || !defined(NDEBUG)
128+
TkFinalize(NULL);
129129
# elif defined(_WIN64)
130130
__asm__ __volatile__ (
131131

0 commit comments

Comments
 (0)