Prevent excessive su requests

This commit is contained in:
topjohnwu
2017-01-30 00:44:33 +08:00
parent 13512b4146
commit d9597549fd
2 changed files with 72 additions and 25 deletions
@@ -16,6 +16,14 @@ public class CallbackHandler {
list.add(listener);
}
public static void unRegister(Event event) {
HashSet<EventListener> list = listeners.get(event);
if (list != null) {
list.clear();
listeners.remove(event);
}
}
public static void unRegister(Event event, EventListener listener) {
HashSet<EventListener> list = listeners.get(event);
if (list != null) {