Ext version tested:
  • Sencha 2.0.1
Browser versions tested against:
  • Chrome 19.0
  • When a store is created it is added to by storeId as a key.
  • However store.destroy() doesn't remove it from the store's cache. So, the longer the application is used, the more memory is consumed as none of stores is actually released.
  • Calling Ext.StoreManager.unregister(store.getStoreId()) explicitly removes store reference from the cache. However I suppose that this should be done in destroy() method as even DataView relies on it when updating store to new (DataView.updateStore()) or am I missing anything?
Steps to reproduce the problem:
  • Create a store
  • Check -> store is added
  • Call store.destroy()
  • Check -> store is still there, only isDestroyed flag is set to true
Test Case:
  Ext.define('User', {    extend: '',
    config: {
        fields: [
            {name: 'firstName', type: 'string'},
            {name: 'lastName',  type: 'string'},
            {name: 'age',       type: 'int'},
            {name: 'eyeColor',  type: 'string'}

var data = [
        {firstName: 'Ed',    lastName: 'Spencer'},
        {firstName: 'Tommy', lastName: 'Maintz'},
        {firstName: 'Aaron', lastName: 'Conran'},
        {firstName: 'Jamie', lastName: 'Avins'}
var store1 = Ext.create('', {
    model: 'User', 
    storeId: 'test-store-1',
    data : data
}); // 'test-store-1' is added to cache
store1.destroy() // 'test-store-1' is still in cache

var store2 = Ext.create('', {
    model: 'User', 
    storeId: 'test-store-2',
    data : data
store2.autoDestroy = true;

var touchTeam = Ext.create('Ext.DataView', {
    fullscreen: true,
    store: store2,
    itemTpl: '{name} is {age} years old'
});  // 'test-store-2' is in cache

var store3 = Ext.create('', {
    model: 'User', 
    autoDestroy: true,
    storeId: 'test-store-3',
    data : data

touchTeam.setStore(store3) // 'test-store-2' is still in cache though shouldn't, as expected to be destroyed
Thank you in advance,