Hello !

I'm trying to use Ext.util.DelayedTask to do a repeated task like setInterval does.
My following code works into the initialize function of an Ext.container :

Code:
var task = new Ext.util.DelayedTask(function(active) {               
                home_controller.RefreshAlarmsCount();
                this.fireEvent("TaskEnded");
            }, this),
            refreshAlarms = function(active) {
                if (active) {
                    task.delay(1000);
                    this.on('TaskEnded', task);
                } else if (!active) {
                    if (this.hasListener('TaskEnded')){
                        this.removeListener('TaskEnded');
                    }
                    task.cancel();
                }
            };

this.on('show', function() {
            refreshAlarms(true);
        });
        this.on('hide', function(){
            refreshAlarms(false);
        }),
But each time the fireEvent is fired, I get this error message into Chrome's console :

Uncaught TypeError: Object [object Object] has no method 'apply'
Ext.define.doFire
Ext.define.fire
Ext.define.doDispatchEvent
Ext.define.dispatchEvent
Ext.define.doFireEvent
Ext.define.fireEvent
(anonymous function)
call

However, the task is repeating and is cancelling like I expected.
Am I doing something wrong or is it a bug ?