Results 1 to 5 of 5

Thread: destroyStore in AbstractStore.js

    You found a bug! We've classified it as EXTJS-12040 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    15

    Default destroyStore in AbstractStore.js

    Code:
    destroyStore: function() {
            var implicitModelName,
                me = this;
    
    
            if (!me.isDestroyed) {
                me.clearListeners();
                if (me.storeId) {
                    Ext.data.StoreManager.unregister(me);
                }
                me.clearData();
                me.data = me.tree = me.sorters = me.filters = me.groupers = null;
                if (me.reader) {
                    me.reader.destroyReader();
                }
                me.proxy = me.reader = me.writer = null;
                me.isDestroyed = true;
    
    
                if (me.implicitModel) {
                    implicitModelName = Ext.getClassName(me.model);
                    Ext.undefine(implicitModelName);
                    Ext.ModelManager.unregisterType(implicitModelName);
                } else {
                    me.model = null;
                }
            }
        },
    Is this a bug ?? There is no "reader" in Store. Reader is in proxy. Should the codes be

    Code:
                if (me.proxy.reader) {
                    me.proxy.reader.destroyReader();
                }

  2. #2
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,339

    Default

    I'd expect of have this code fragment in the destroyStore method.

    The proxy should be responsible for destroying the reader.

    Code:
    if (me.proxy) {
        me.proxy.destroyProxy();
    }

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report! Can you please post a test Fiddle which reproduces the problem to which you are referring? Thanks.
    https://fiddle.sencha.com/#home

  4. #4
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,339

    Default

    Is this not obvious just by looking at the code that it's not right since the reader should be defined on the proxy, not on the store?

    It might be hard for the OP to demonstrate that stores are not destroyed properly.

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •