Are initComponent functions stored in memory after component destruction, or are these storages collected?

This is a question that grew out of this other:

Best practice to have the same look and store multiple times in ExtJS 4

So, in the scenario where the repositories are created in the initComponent function of the grid.

Should I override onDestroy grids to also destroy the repository?

Or will these stores collect garbage because there simply are no links to them?

+2
source share
1 answer
  • No, the store will still exist after the destruction of the Grid
  • No, you don’t need to redefine the mesh destruction method

You can force the repository to destroy itself by setting the autoDestroy flag to true API-Link

 autoDestroy : Boolean 

When the repository is used by only one DataView, it should exist only for the lifetime of this view, then set the autoDestroy flag to true. This leads to the destruction of the idea to launch the destruction of his store.

 Defaults to: false 

See this working demo for the autoDestroy effect in the storage used by the grid (close the grids in the demo)

Additional Information:

+5
source

Source: https://habr.com/ru/post/1208503/


All Articles