Skip to content

Dictionary contents were not destructed propery #338

@yosagi

Description

@yosagi

I tried to access InputMap via ProjectSettings with following code.

Variant action_v = ProjectSettings::get_singleton()->get(String("input/ui_up"));
Dictionary action = action_v;
// do something with "action"

I expected "action" is property destructed when it goes out of scope. But the code leaks something and the engine report them on exit.

WARNING: ObjectDB::cleanup: ObjectDB Instances still exist!
     At: core\object.cpp:2069
Leaked instance: InputEventJoypadButton:35 - Resource name:  Path:
Leaked instance: InputEventKey:34 - Resource name:  Path:
Orphan StringName: InputEventKey
Orphan StringName: InputEventJoypadButton
StringName: 2 unclaimed string names at exit.

If I manually clear the Dictionary, no leak is reported.

Variant action_v = ProjectSettings::get_singleton()->get(String("input/ui_up"));
Dictionary action = action_v;
action.clear();

Version: godot (3.1.1.stable.official) + godot-cpp(cdd5026)
Version: godot (3.2.alpha.custom_build.8c3a5057c) + godot-cpp(123d9f0)
Platform: windows10, 64bit build

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions