View Full Version : Ext.gesture.Manager.removeEventListener bug?

1 Feb 2012, 4:39 AM
Sencha Touch version tested:

Platform tested against:

Google Chrome
HTC Incredible S710e with Android 2.3.5

Ext.gesture.Manager.addEventListener always add new event targets to this.targets (if the target is not there already)
Ext.gesture.Manager.removeEventListener newer removes event targets from this.targets
The number of targets in Ext.gesture.Manager.targets will continue to grow for as long as the application is running
This causes my phone to freeze in a Ext.List if I just repeatedly scroll the list up and down and click in to the item and back to the list (running in PhoneGap - i need to close the app from the Android settings menu when it freezes and there are no error messages in the console)
Sample code:

<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="lib/sencha/resources/css/sencha-touch.css" type="text/css">
<script type="text/javascript" src="lib/sencha/sencha-touch-debug-w-comments.js"></script>
<script type="text/javascript" src="bug.js"></script>

onReady: function() {
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']

var store = new Ext.data.JsonStore({
model : 'Contact',
sorters: 'lastName',

getGroupString : function(record) {
return record.get('lastName')[0];

data: [
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Rob', lastName: 'Dougan'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'}

Ext.reg("listview", Ext.extend(Ext.List, {
fullscreen: true,
itemTpl : '{firstName} {lastName}',
store: store,
listeners : {
itemtap : function(list, index, element) {
var item = mainView.setMainContent({
xtype : "itemview",
fullName: element.innerText

Ext.reg("itemview", Ext.extend(Ext.Panel, {
fullscreen: true,
items: [{
xtype: 'panel',
html: 'Showing the item!'
}, {
xtype: 'button',
text: 'Back',
handler: function() {
xtype : "listview"
layout: 'vbox'

Ext.reg("mainview", Ext.extend(Ext.Panel, {
fullscreen : true,
layout : 'fit',
setMainContent : function(componentConfig) {
var me = this;
var currentContent = this.getComponent("content");
if (currentContent) {
if (componentConfig != null) {
Ext.applyIf(componentConfig, {
id : "content"
var newContent = Ext.ComponentMgr.create(componentConfig);

var mainView = Ext.ComponentMgr.create({
xtype : "mainview"

xtype : "listview"

Steps to reproduce the problem:

Click on an item in the list
Click on the "Back" button
Ext.gesture.Manager.targets has now been increased by 3 targets
Possible fix:

Add this.targets.remove(target) to Ext.gesture.Manager.removeEventListener

1 Feb 2012, 9:52 AM
Gestures are totally different in ST2 so this bug may not be relavant anymore.

1 Feb 2012, 3:05 PM
It is relevant whether you can confirm that it is a bug and that the fix is correct (or we are doing something wrong in the way we use ST1).

ST2 is a preview release and therefore not ready for production.