]> source.dussan.org Git - gwtquery.git/commitdiff
Test callbacks disable method
authorManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Wed, 27 Feb 2013 19:57:27 +0000 (20:57 +0100)
committerManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>
Wed, 27 Feb 2013 19:57:27 +0000 (20:57 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/callbacks/Callbacks.java
gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryDeferredTestGwt.java

index 58992a4e68e9f32cc1df9093393d09a98e302e9a..a91379ab037cd70f33b81638d202286b8dfc8716 100644 (file)
@@ -120,7 +120,7 @@ public class Callbacks {
    */
   public Callbacks disable() {
     callbacks = JsObjectArray.create();
-    memory = JsObjectArray.create();
+    memory = null;
     done = true;
     return this;
   }
index 3f5919a5fa280e8f74c3e02484a4a0ccfa089c78..9bcc48841210fecfb563c59b611d8acfa7a2780c 100644 (file)
@@ -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);
   }
 
 }