In our application, we are having various windows which contain grid and their respective stores. General code structure of a window we have is as following:
function showWin(){
var storeVar = //code for store
var gridVar = //code for grid with store as storeVar
var winVar = //code for window having gridVar as item
winVar.show();
}
This showWin() function is being called say on a button click which displays the window.
Now when this window is closed then it is destroyed along with its child item grid. But does this also destroy the store associated with the grid? I guess not.
Thus, if storeVar is not destroyed on closing of window (more precisely on destruction of grid) then should this be forcefully removed in order to reduce the extra baggage (as a new copy gets created everytime the function is called) from the memory? If yes, how?
Thanks for any help in advance.
PS: We are using ExtJs ver 4.0.7
Asked the same question in sencha forum and as per the answer received there, I guess that the store doesn't need to be destroyed forcefully as the garbage collector would itself take care of it. More here.
Updating the things here too, hoping it helps someone else looking for the same.