From b53d0bf7af56dc44cecbf6d58529855fd54a74a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Manuel=20Carrasco=20Mo=C3=B1ino?= Date: Wed, 27 Feb 2013 20:57:27 +0100 Subject: [PATCH] Test callbacks disable method --- .../google/gwt/query/client/plugins/callbacks/Callbacks.java | 2 +- .../com/google/gwt/query/client/GQueryDeferredTestGwt.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 58992a4e..a91379ab 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 @@ -120,7 +120,7 @@ public class Callbacks { */ public Callbacks disable() { callbacks = JsObjectArray.create(); - memory = JsObjectArray.create(); + memory = null; done = true; return this; } diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryDeferredTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryDeferredTestGwt.java index 3f5919a5..9bcc4884 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryDeferredTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryDeferredTestGwt.java @@ -136,6 +136,10 @@ public class GQueryDeferredTestGwt extends GWTTestCase { callbacks.remove( fn1 ); callbacks.add( fn1 ); assertEquals(" f1: bar f2: bar f2: bar f1: bar", result); + callbacks.remove( fn1 ); + callbacks.disable(); + callbacks.add( fn1 ); + assertEquals(" f1: bar f2: bar f2: bar f1: bar", result); } } -- 2.39.5