PDA

View Full Version : [OPEN] destroyStore in AbstractStore.js



mf913
7 Jan 2014, 7:20 AM
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



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

LesJ
7 Jan 2014, 8:32 AM
I'd expect of have this code fragment in the destroyStore method.

The proxy should be responsible for destroying the reader.


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

Gary Schlosberg
11 Jan 2014, 7:38 AM
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

LesJ
12 Jan 2014, 8:15 AM
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.

Gary Schlosberg
17 Jan 2014, 9:06 PM
Thanks for the report! I have opened a bug in our bug tracker.