From: Manuel Carrasco MoƱino Date: Wed, 27 Feb 2013 19:57:27 +0000 (+0100) Subject: Test callbacks disable method X-Git-Tag: release-1.3.2~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b53d0bf7af56dc44cecbf6d58529855fd54a74a0;p=gwtquery.git Test callbacks disable method --- 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); } }