fix(amulegui): persist list-control settings on every macOS quit path - #290
Merged
Merged
Conversation
CMuleListCtrl::SaveSettings runs from the frame's destructor, which CamuleDlg::OnClose -> CamuleRemoteGuiApp::ShutDown only schedules (amuledlg->Destroy(), lazy). CamuleRemoteGuiApp::OnExit then std::_Exit(0)s to dodge the wxWebSession dtor crash, which skips wx's own cleanup, so the queued destroy and the wxConfig flush never happen and freshly-resized column widths / sort orders are silently lost. Cmd+Q happened to drain the queue naturally, which is why only that path persisted. Two fixes, mirroring the monolithic app: - OnExit: DeletePendingObjects() + tear down wxConfig (which flushes it) before _Exit(0), so the red-X + confirm path runs the list-control destructors against a live config. Mirrors CamuleApp::OnExit (amule-project#141). - OnQueryEndSession / OnEndSession handlers: the macOS Dock right-click -> Quit path ends the session without going through OnExit, so route it through ShutDown + OnExit explicitly. Mirrors CamuleGuiApp (amule-gui.cpp).
got3nks
force-pushed
the
fix/amulegui-persist-listctrl
branch
from
July 4, 2026 10:00
4b22954 to
0608697
Compare
Cflsft
pushed a commit
to Cflsft/amule
that referenced
this pull request
Jul 6, 2026
…amule-org#290) CMuleListCtrl::SaveSettings runs from the frame's destructor, which CamuleDlg::OnClose -> CamuleRemoteGuiApp::ShutDown only schedules (amuledlg->Destroy(), lazy). CamuleRemoteGuiApp::OnExit then std::_Exit(0)s to dodge the wxWebSession dtor crash, which skips wx's own cleanup, so the queued destroy and the wxConfig flush never happen and freshly-resized column widths / sort orders are silently lost. Cmd+Q happened to drain the queue naturally, which is why only that path persisted. Two fixes, mirroring the monolithic app: - OnExit: DeletePendingObjects() + tear down wxConfig (which flushes it) before _Exit(0), so the red-X + confirm path runs the list-control destructors against a live config. Mirrors CamuleApp::OnExit (amule-org#141). - OnQueryEndSession / OnEndSession handlers: the macOS Dock right-click -> Quit path ends the session without going through OnExit, so route it through ShutDown + OnExit explicitly. Mirrors CamuleGuiApp (amule-gui.cpp).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS, resizing the peers-table (or any list-control) columns in amulegui only persisted when quitting with Cmd+Q. Exiting with the red X → confirm dialog, or Dock right-click → Quit → confirm, silently discarded the changes.
CMuleListCtrl::SaveSettingsruns from the frame's destructor, whichCamuleDlg::OnClose → CamuleRemoteGuiApp::ShutDownonly schedules (amuledlg->Destroy()is lazy).CamuleRemoteGuiApp::OnExitthenstd::_Exit(0)s to dodge the wxWebSession dtor crash (#18 / #159), which skips wx's own cleanup — so the queued destroy and the wxConfig flush never run and the freshly-written column widths / sort orders are lost. Cmd+Q happened to drain the pending-delete queue naturally, which is why only that path persisted.Fix
Mirrors the monolithic app in two places:
OnExit—DeletePendingObjects()+ tear down wxConfig (which flushes it) before_Exit(0), so the red-X + confirm path runs the list-control destructors against a live config. Same idea asCamuleApp::OnExit(fix(macos): persist list-control settings on Dock → Quit #141).OnQueryEndSession/OnEndSessionhandlers — the Dock right-click → Quit path ends the session without going throughOnExit, so route it throughShutDown+OnExitexplicitly. MirrorsCamuleGuiApp(amule-gui.cpp).Testing
macOS, resized the Transfers/peers columns and verified persistence across relaunch on all three quit paths: Cmd+Q, red X → confirm, and Dock → Quit → confirm. All three now save.