0

I am new to slickgrid and was trying to understand destroy() function.

Was going through the link about destroying the grid after success call.

Could anyone please let me know what is difference between mySlickgrid.destroy() and mySlickgrid = null?

Also, read about some memory leak in this link.

Does writing mySlickgrid = null would prevent memory leak and serve the same purpose as destroy()?

Community
  • 1
  • 1
Mrudang Vora
  • 255
  • 1
  • 5
  • 20

1 Answers1

0

There are some handlers and events that won't get cleaned up when you just set the grid to null, so you should definitely call destroy on it before nulling it out. It's possible that also setting it to null causes some stuff to get released (if destroy isn't thorough enough), but I don't know in detail. I always set it to null after destroying as a best practice.