[[ Bug 13626 ]] Prevent crash caused by static variable not being set to nil before exit
Merge pull request #1256 from runrevali/bugfix-13626

[[ Bug 13626 ]] Prevent crash due to not clearing static variable before exit.