From 7513fb3ead3b5a6d4c4d790b64d1801643cea20d Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 22 Dec 2010 16:46:19 +0000 Subject: util.filters: Add remove_filter_hook() --- util/filters.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util') diff --git a/util/filters.lua b/util/filters.lua index f304e71a..d143666b 100644 --- a/util/filters.lua +++ b/util/filters.lua @@ -76,4 +76,12 @@ function add_filter_hook(callback) t_insert(new_filter_hooks, callback); end +function remove_filter_hook(callback) + for i=1,#new_filter_hooks do + if new_filter_hooks[i] == callback then + t_remove(new_filter_hooks, i); + end + end +end + return _M; -- cgit v1.2.3