CClientLog was the only sub-connection dialog without ON_WM_CLOSE, so
the close button did nothing and the window stayed until the master
exited. It now wires WM_CLOSE like the other dialogs: it detaches the
context's dialog pointer and cancels the log sub-connection before
destroying, so the client's three-second log push loop stops instead of
posting increments to a destroyed window.
Every menu click also opened a new dialog and a new log sub-connection:
the client starts one per COMMAND_QUERY_LOG, and each arrives on a new
context whose hDlg is empty, so the existing "append to open dialog"
path never matched. The master now keeps one log window per client id;
a repeat request closes the previous sub-connection, rebinds the window
to the new one and refreshes the snapshot instead of opening another.
Verified on the Debug server: WM_CLOSE destroys the window, two extra
clicks keep a single window, and the main connection stays online.
Co-Authored-By: deepseek-flash
The Win32 EDIT control caps text at ~32K/64K chars by default, so the
client log dialog silently stopped accepting appends long before the
512KB truncation logic could run. Call SetLimitText(0) in both
CClientLog and CActivityDialog to lift the cap.
Also unify newline handling in Logger: each entry now ends with exactly
one '\n' at the source, so the in-memory ring-buffer dump (used by the
TCP log query) splits into lines correctly instead of relying on every
Mprintf caller ending its format with '\n'. writeToFile drops the extra
std::endl accordingly.
Additionally fix a CFont leak in CClientLog::OnInitDialog by moving the
font to a member.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>