util.events: Fix loop construct (negative step required)
authorMatthew Wild <mwild1@gmail.com>
Tue, 24 Apr 2018 22:58:46 +0100
changeset 8761 c380a22d52d5
parent 8760 861a7d6c12d8
child 8762 9e839fb4541a
child 8792 4ae8dd415e94
util.events: Fix loop construct (negative step required)
util/events.lua
--- 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