_UnhandledInput bug? Generated objects won't remove by itself, need to use "@event.Dispose();"

Godot Version



Hi! I just noticed that when I’m using _UnhandledInput the chart of “objects” in Monitoring tab of debugger is increasing when I click, move mouse etc.



I need to use @event.Dispose() to clear input objects, then the object chart is flat, everything works as indeded, so my question is, is it a “bug”? or because of C#? (I’m using C# in godot)

Hi :slightly_smiling_face:
This is not a bug, those objects are going to be collected whenever the GC deems it necessary. If you want, or feel the need, to be deliberate about it, you can either @event.Dispose() them (or pop a using @event at the top of the block).

See: C# Input object creation explosion · Issue #76607 · godotengine/godot · GitHub, Infinite object growth with input activity (c# mono) · Issue #78065 · godotengine/godot · GitHub, and probably others.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.