]> source.dussan.org Git - gwtquery.git/commitdiff
fix issue #12
authorjdramaix <julien.dramaix@gmail.com>
Wed, 23 Jan 2013 00:50:03 +0000 (01:50 +0100)
committerjdramaix <julien.dramaix@gmail.com>
Wed, 23 Jan 2013 00:50:03 +0000 (01:50 +0100)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/events/EventsListener.java

index 6ba03baeefb507bea204170cd1c54ebf9585f786..1f239fdc2be56eb3fe75ad828a105ef8a4d073d7 100644 (file)
@@ -16,6 +16,7 @@ package com.google.gwt.query.client.plugins.events;
 import static com.google.gwt.query.client.GQuery.$;
 
 import com.google.gwt.core.client.Duration;
+import com.google.gwt.core.client.JsArrayString;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.EventTarget;
 import com.google.gwt.dom.client.NodeList;
@@ -531,12 +532,18 @@ public class EventsListener implements EventListener {
       for (String k : liveBindFunctionByEventType.keys()) {
         LiveBindFunction liveBindFunction = liveBindFunctionByEventType.<JsCache> cast().get(k);
         liveBindFunction.removeBindFunctionForSelector(cssSelector, nameSpace, null);
+        if (liveBindFunction.isEmpty()){
+          liveBindFunctionByEventType.<JsCache>cast().delete(k);
+        }
       }
     } else {
       LiveBindFunction liveBindFunction = liveBindFunctionByEventType.get(eventbits);
       if (liveBindFunction != null) {
         liveBindFunction.removeBindFunctionForSelector(cssSelector, nameSpace, originalEventName);
       }
+      if (liveBindFunction.isEmpty()){
+        liveBindFunctionByEventType.remove(eventbits);
+      }
     }
   }