Page MenuHomeFeedback Tracker

Circular Reference in Hashmap on Game Save
Feedback, NormalPublic

Description

Referencing a hashmap twice within another hashmap results in a "Circular reference found in HashMap" warning when attempting to save the game.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

1.) Run code in debug console:

m = createHashMap;
map = createHashMap;
map set ["a", m];
map set ["b", m];

2.) Click save
3.) Check rpt for following output:

Circular reference found in HashMap, this will cause a memory leak!
➥ Context: Hash Key: "b" <- Serialize Game Variable: map
Additional Information

Event Timeline

bbaanngg created this task.Apr 15 2024, 9:01 AM
dedmen added a subscriber: dedmen.Apr 24 2024, 11:11 AM

Thats what I deserve for copy pasting code and then only fixing a bug in one of the two.
There is also a memory leak in there, on every save for every hashmap serialization.

dedmen changed the task status from New to Feedback.Apr 24 2024, 11:18 AM