Skip to content
Snippets Groups Projects
Commit d96e30da authored by Samuel Wegner's avatar Samuel Wegner
Browse files

Set can_see_cache to weak table

Previously, if the "can_see_cache" property is not initialized when
Actor.canSee() is called, it will be set to a strong table. This seems
bad because this table can hold references to other actors and possibly
prevent garbage collection. Actor.resetCanSeeCache() sets
"can_see_cache" to a weak table, so I think the same should be done for
initializing the property in Actor.canSee().

Now, Actor.canSee() will initialize "can_see_cache" with a weak table
if it doesn't already exist.

I stumbled across this while investigating the Warden's Call memory
leak and found references to the clones in game.player.can_see_cache.
Unfortunately, this change doesn't seem to fix that problem.
parent be5dd613
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment