https://gitlab.synchro.net/main/sbbs/-/commit/f65fd89a106023a5aa7570ce
Modified Files:
src/sbbs3/ctrl/MainFormUnit.cpp
Log Message:
Resolve crashes during graceful server termination(s)
These crashes have been happening seemingly forever, but only noticed (by me) when running in a debugger, otherwise Windows seems to suppress any exception message/popup since the process terminates anyway.
The problem appears to be that we were setting app controls (e.g. start/stop button states) in the startup->set_state callbacks and it was possible through race conditions that the application (or at least the forms) were actually destroyed already at the time those callbacks are called (to a report server state of STOPPED as one of the last things each server thread does).
The solution was to store the value of the reported server states in (global) variables and asynchronously (at "appy time") update the relevant controls based on the server state(s). Since the LogTimer runs more frequently (2Hz) than UpTimer (1Hz) and isn't stopped (early) during process termination,
that was the place best-suited to do these control updates.
In this process, I also made the app controls make more sense (e.g. the
"Start" button is disabled during server initialization) and the "Abort" dialing while waiting for graceful server termination(s) is much improved
(e.g. lists all the servers still running), but now it does not popup for 60 seconds after termination requested (rather than 30 seconds as before) - as
if the user presses "Yes", this initiates an *ungraceful* exit of the program which could result in crashes (though Microsoft seems to suppress the user notification of these).
---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net