--- a/src/Wt/WLocale.C	2026-07-13 08:42:56.734246537 +0000
+++ b/src/Wt/WLocale.C	2026-07-13 08:53:28.330784984 +0000
@@ -8,7 +8,12 @@
 namespace Wt {
 
 namespace {
-thread_local WLocale currentLocale_;
+// ~WebSession calls log() -> calls WLocale::currentLocale() -> accesses currentLocale_
+//             that may be already destroyed.
+// Workaround: just use global systemLocale if WApplication::instance() is NULL
+//             and its WApplication::locale() cannot be accessed
+//
+// thread_local WLocale currentLocale_;
 const WLocale systemLocale;
 }
 
@@ -95,7 +100,8 @@
   if (app)
     return app->locale();
   else
-    return currentLocale_;
+    // return currentLocale_;
+    return systemLocale;
 }
 
 bool WLocale::isDefaultNumberLocale() const
@@ -232,9 +238,9 @@
   if (app) {
     app->setLocale(locale);
   }
-  else {
-    currentLocale_ = locale;
-  }
+  // else {
+  //  currentLocale_ = locale;
+  // }
 }
 
 }
