diff options
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/callbacks/Callbacks.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/callbacks/Callbacks.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/callbacks/Callbacks.java index a91379ab..0a34b5d5 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/callbacks/Callbacks.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/callbacks/Callbacks.java @@ -119,8 +119,7 @@ public class Callbacks { * Disable a callback list from doing anything more. */ public Callbacks disable() { - callbacks = JsObjectArray.create(); - memory = null; + callbacks = memory = null; done = true; return this; } @@ -152,13 +151,15 @@ public class Callbacks { } private void addAll(Object...o) { - for (Object c : o) { - if (!opts.getUnique() || !callbacks.contains(c)) { - callbacks.add(c); - } - // In jQuery add always is run when memory is true even when unique is set - if (opts.getMemory() && memory != null) { - run(c, memory.elements()); + if (callbacks != null) { + for (Object c : o) { + if (!opts.getUnique() || !callbacks.contains(c)) { + callbacks.add(c); + } + // In jQuery add always is run when memory is true even when unique is set + if (opts.getMemory() && memory != null) { + run(c, memory.elements()); + } } } } |