Skip to content

Commit

Permalink
Prevent memleak when 'use_entities' is off
Browse files Browse the repository at this point in the history
  • Loading branch information
matpow2 committed Nov 27, 2018
1 parent f84d9b7 commit dc9174d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cuwo/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,14 @@ def update(self, dt):
self.dt = dt
self.retire_chunks()

hits = self.hits
passives = self.passives
self.hits = []
self.passives = []
if not self.use_entities:
return None

tgen.set_in_packets(self.hits, self.passives)
self.hits = []
self.passives = []
tgen.set_in_packets(hits, passives)

# we need to save and restore the hostile type so tgen does not
# deallocate our entities
Expand Down

0 comments on commit dc9174d

Please sign in to comment.