Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Touch Premium Member
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,299
    Vote Rating
    109
    LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light LesJ is a glorious beacon of light

      0  

    Default [4.1] Ext.app.Controller.getRef - update references on beforedestroy

    [4.1] Ext.app.Controller.getRef - update references on beforedestroy


    I think the array of references should be updated (ref removed) when the cached component is destroyed.
    Code:
    Ext.define('Ext.app.Controller', {
        ....
        getRef: function(ref, info, config) {
            ...
            if (!cached) {
                me.refCache[ref] = cached = Ext.ComponentQuery.query(info.selector)[0];
                if (!cached && info.autoCreate) {
                    me.refCache[ref] = cached = Ext.ComponentManager.create(info, 'component');
                }
                if (cached) {
                    cached.on('beforedestroy', function() {
                        me.refCache[ref] = null;
                        Ext.Array.remove(me.references, ref); // <-- add this line?             
                    });
                }
            }
    
    
            return cached;
        },
        ....
    EDIT:
    The Ext.app.Controller class needs better internal doc. I think the ref and getRef methods are private, but addRef and hasRef are public. This is not documented.

    EDIT 6/30
    After rethinking, I'm not sure if there's a need to make this change, so please feel free to close this ticket.
    Last edited by scottmartin; 30 Jun 2012 at 3:09 PM. Reason: Add doc comment

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,884
    Vote Rating
    440
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Done.

    Scott.

Thread Participants: 1