Skip to content

Fix an editbox freeze, lobby listener leaks and small errors - #925

Open
moss-orbit-9f339e wants to merge 11 commits into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:fix/lobby-fixes-2
Open

moss-orbit-9f339e wants to merge 11 commits into
ZeroK-RTS:masterfrom
moss-orbit-9f339e:fix/lobby-fixes-2

Conversation

@moss-orbit-9f339e

@moss-orbit-9f339e moss-orbit-9f339e commented Oct 12, 2026 •

Copy link
Copy Markdown

Ten more lobby fixes, one commit each. They do not change files from #924.

Errors and wrong behaviour

  • Chili EditBox: deleting a selection could hang the lobby. ClearSelected looped until the cursor was equal to the selection start, but when the selection ends inside a multibyte character, Utf8BackspaceAt steps over the start. Ctrl+A in an empty multiline box indexed self.lines[0].
  • Login: a registration reply that arrived after the dialog was cancelled called ShowPassword on a window that no longer existed.
  • Steam coop: Cancel on "Starting coop game" called Start, so it connected instead of cancelling.
  • Map list: the filter text was used as a Lua pattern, so -, . or [ in the search gave wrong results or an error. It is now plain text.
  • ChiliFX: SetEffect logged "No such effect" and then continued with a nil effect.

Leaks

  • Chili Screen: the hover link was reused, and each hover change added a closure to its metatable (1,006 entries after 1,000 hover changes in a test, 7 with new links).
  • Console: each chat console added a configuration listener that was never removed, so closed consoles were never freed. Delete now removes it, and both chat close buttons call Delete.
  • Battle status panel: 12 lobby listeners were added for each battle joined and never removed. They are now removed when the battle tab is disposed.
  • User handler: a control that was made again added one more resize function each time. The previous one is now replaced.
  • Commander loadout: resize functions of cleared module buttons stayed in the list. Clear now removes them.

Testing (Windows, RTX 3080, engine 2026.09.01-17-gad28d7b)

Update after review (e26355e): closing a channel or a private chat also clears its entries in tabbars and userListPanels, and the battle room console calls Console:Delete when the battle room closes. Lobby start in menu mode (offline): no new LuaMenu errors (the one error on master is fixed by #924).

AI disclosure: OpenAI Codex (GPT-6.1 Sol) and GLM 5.3 found these bugs in code reviews. Claude Code reviewed each fix, made several of them smaller, and ran the tests. I reviewed the changes.

🤖 Generated with Claude Code

moss-orbit-9f339e and others added 10 commits October 12, 2026 00:13
…control

Cached user controls are reinitialized on every request while the main
lobby is disconnected, e.g. each time singleplayer skirmish is reopened.
Each pass appended another resize closure to the same control; replace
the previous one instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each console added an OnConfigurationChange listener that was never
removed, so every closed channel or private chat stayed in memory.
Console:Delete now removes it, and the chat close buttons call Delete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…moved

Every battle join builds a new status panel that registers twelve lobby
listeners, and none were removed, so old panels stayed in memory and kept
handling every battle update. Remove them when the panel is disposed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each module button adds a resize function to the persistent list panel.
Clear removed the buttons but not these functions, so every loadout
rebuild (save load, level up) kept the old name boxes and their resize work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…osed

Cancelling the Steam registration dialog disposes its window and sets
window to nil, but the dialog stays current. A later "name already exists"
reply then called ShowPassword, which errored on the missing window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The filter terms were used as Lua patterns, so typing characters such
as '[', '(' or '%' raised an error and stopped the filtering.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The popup's close function was Start, so Cancel or Escape connected to
the host at once instead of cancelling. Cancel now drops the pending
connection, and the delayed start connects before closing the popup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When an effect shader failed to compile, SetEffect logged "No such
effect" and then indexed the missing effect, so the rank-up popup errored
before it was shown. Return after logging and leave the control as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…empty

A mouse selection can end inside a multibyte character. Deleting it
stepped over that end and the loop never stopped, freezing the lobby;
stop once the cursor reaches or passes it. Ctrl+A on an empty multiline
box indexed a missing last line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reusing the hover link made MakeWeakLink add another closure to the
link's metatable and another entry to the control's link list on every
hover change, so both grew while the mouse moved over the lobby.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closing a channel or a private chat left the console in self.tabbars
(and the channel user list in self.userListPanels), so it was never
freed. These entries are now cleared; they are set again when the
console is opened again. The battle room console now calls
Console:Delete when the battle room closes, so its configuration
listener goes away.

Found by a Codex review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant