This is a very minor bug, probably won’t affect anything, but…
Today, in attempting to create a custom character system, I decided to fork the control/camera core scripts using the fancy new Luau types
Turns out there’s a minor, completely insignificant, but… present… type error that can cause a memory leak:
The code in question is located at PlayerModule.ControlModule.Keyboard, line 162
This is a typo written 3 times—the identifier should be textFocusReleasedConn, not textFocusReleasedCon
The only time this memory leak will matter is if a player switches input lots of times from Keybord+Mouse to another scheme while in game. It probably wasn’t worth reporting. But I thought I’d do so to show off how effectively the new type system can, in fact, catch bugs in existing code.
It’s a typo in corescript logic, it shouldn’t require repro code. Just have the engineer open the script pointed out and review static analysis warnings.
@DataBrain it’s probably better to retitle this to be less about memory leaks and more about there just being a typo preventing cleanup of a connection. Looks like adding the “memory leak” part confused some DevRel people and engineers in the bug reporting process.
The code isn’t my code, it’s yours. Like I said in the original post, it’s located at PlayerModule.ControlModule.Keyboard, line 162 in the core PlayerModule scripts
Running a Play Solo test on an empty place should make this appear in your player’s PlayerScripts: PlayerModule.rbxm (121.8 KB)