Skip to content

Fix newly-created profile reappearing after restart when deleted#83

Merged
jmquigs merged 1 commit into
masterfrom
claude/fix-profile-deletion-bug-7FJk3
May 15, 2026
Merged

Fix newly-created profile reappearing after restart when deleted#83
jmquigs merged 1 commit into
masterfrom
claude/fix-profile-deletion-bug-7FJk3

Conversation

@jmquigs
Copy link
Copy Markdown
Owner

@jmquigs jmquigs commented May 15, 2026

A profile created via "New Profile" in MMLaunch holds an empty ProfileKeyName in memory. Picking an EXE triggers RegConfig.saveProfile, which lazily creates a registry subkey (e.g. Profile0000) but discarded its name via ignore, so the in-memory RunConfig stayed unsynced. The delete handler skipped RegConfig.removeProfile because ProfileKeyName was still "", leaving the orphan subkey to be re-enumerated by loadAll on next launch.

saveProfile now returns the updated RunConfig with ProfileKeyName set to the bare subkey name, and ProfileModel.save assigns it back to its mutable config. This keeps in-memory state consistent with the registry so the existing delete guard works on the first try.

A profile created via "New Profile" in MMLaunch holds an empty
ProfileKeyName in memory. Picking an EXE triggers RegConfig.saveProfile,
which lazily creates a registry subkey (e.g. Profile0000) but discarded
its name via `ignore`, so the in-memory RunConfig stayed unsynced.
The delete handler skipped RegConfig.removeProfile because
ProfileKeyName was still "", leaving the orphan subkey to be
re-enumerated by loadAll on next launch.

saveProfile now returns the updated RunConfig with ProfileKeyName set
to the bare subkey name, and ProfileModel.save assigns it back to its
mutable config. This keeps in-memory state consistent with the registry
so the existing delete guard works on the first try.
@jmquigs
Copy link
Copy Markdown
Owner Author

jmquigs commented May 15, 2026

Fixes #3

@jmquigs jmquigs merged commit c4d3abf into master May 15, 2026
1 check passed
@jmquigs jmquigs deleted the claude/fix-profile-deletion-bug-7FJk3 branch May 15, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants