-
29 Jun 2012 10:36 AM #1
[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.
EDIT: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; }, ....
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
-
30 Jun 2012 3:09 PM #2
Done.
Scott.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote