Attempt to fix memory leak in StateMap

Merged Jake Taylor requested to merge hotfix/MemLeak into release

Merge request reports