Skip to content

Commit

Permalink
Fix ticket unknown-horizons#494.
Browse files Browse the repository at this point in the history
Unsafe to modify lists you are looping in. You can recreate the bug if u have a large number of emitters. My example used to remove 2 out of 4 ..

git-svn-id: http://svn.unknown-horizons.org/trunk@3248 d3468d7a-13f2-4ea4-bf00-366cb6352a40
  • Loading branch information
greyghost committed Feb 27, 2010
1 parent 6e39214 commit e641c91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion horizons/session.py
Expand Up @@ -125,7 +125,7 @@ def end(self):
ExtScheduler().rem_all_classinst_calls(self)

if Settings().sound.enabled:
for emitter in horizons.main.fife.emitter['ambient']:
for emitter in horizons.main.fife.emitter['ambient'][:]:
emitter.stop()
horizons.main.fife.emitter['ambient'].remove(emitter)
horizons.main.fife.emitter['effects'].stop()
Expand Down

0 comments on commit e641c91

Please sign in to comment.