From 0a653027e0f680f48f7f1d6ab961204c48706830 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 10 Jun 2009 05:41:26 +0000
Subject: [PATCH] Resolve js_DestroyContext assertion during reycle of
 event_thread caused by change in rev 1.507 (Dec-20-2008):
 sbbs->event_thread_running was being set to false *before* js_cleanup() was
 being called, so it was possible for the js_cleanup() in the sbbs_t
 destructor to be called simultaneously with the js_cleanup() at the end of
 the event_thread causing mayhem.

---
 src/sbbs3/main.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 9010f0afa9..db924a2adb 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -2750,10 +2750,10 @@ void event_thread(void* arg)
 		mswait(1000);
 	}
 	sbbs->cfg.node_num=0;
-    sbbs->event_thread_running = false;
-
 	sbbs->js_cleanup(sbbs->client_name);
 
+    sbbs->event_thread_running = false;
+
 	thread_down();
 	eprintf(LOG_INFO,"BBS Events thread terminated");
 }
-- 
GitLab