Ext version tested:
  • Sencha Touch 2.1
Browser versions tested against:
  • Safari 5.1
  • By default has useCache=true.
  • Each record of a store configured with such model is added to the that seems to be needed for associations.
  • The problem is that store.destroy doesn't clear So the cache keeps a reference to each record, each record in its turn keeps reference to its store, so that memory doesn't get released.
Steps to reproduce the problem:
  • Define a Model with default configuration.
  • Create a Store with that Model and load some data to it.
  • Call Store.destroy() -> the store is marked as destroyed, store's cache is cleared, but models' cache still keeps all records of the store.
Test Case:
Ext.define('User', {    extend: '',
    config: {
        fields: [
            {name: 'firstName', type: 'string'},
            {name: 'lastName',  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 // user-ext-record-...


store1 // isDestroyed = true, OK // no test-store-1 reference, OK // BUG: all records still there, user-ext-record-..., with reference to test-store-1 each


  • To configure model's useCache=false (not always acceptable) or to call store.removeAll(true) before calling store.destroy().