Diff

util/events.lua @ 8758:c380a22d52d5

util.events: Fix loop construct (negative step required)
author Matthew Wild <mwild1@gmail.com>
date Tue, 24 Apr 2018 22:58:46 +0100
parent 7424:ba83ff7d9bd7
child 8759:9e839fb4541a
line wrap: on
line diff
--- a/util/events.lua	Tue Apr 17 18:40:57 2018 +0200
+++ b/util/events.lua	Tue Apr 24 22:58:46 2018 +0100
@@ -125,7 +125,7 @@
 			w = wrappers[event_name];
 		end
 		if not w then return; end
-		for i = #w, 1 do
+		for i = #w, 1, -1 do
 			if w[i] == wrapper then
 				t_remove(w, i);
 			end