Typo preventing cleanup in default/core PlayerScripts

@AllYourBlox

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:
image

The code in question is located at PlayerModule.ControlModule.Keyboard, line 162
image

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.

27 Likes

Thanks for the report. Please expect a delay in progress due to holidays and we will get back to you as soon as we return.

3 Likes

As per our engineers: We need complete code to reproduce the issue. If Possible can you please add the text file of the code. Thanks !

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.

4 Likes

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)

Thanks for the RBX. I appreciate it.

2 Likes