godotengine / godotengine/godot-cpp
Dictionary contents were not destructed propery
- Dominant language
- C++
- Stars
- 2.7k
- Forks
- 809
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 8
Description
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(cdd50260d0c2bd620f15d16e2e00a4d8c965eb67)
Version: godot (3.2.alpha.custom_build.8c3a5057c) + godot-cpp(123d9f0e9264dcc7206888fc96419b32feef00c8)
Platform: windows10, 64bit build
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.