0

I'm developing an app windows phone 8 and i was wondering making null is a good way to dispose an object from memory or should i do something different or extra to dispose an object...!

Moreover, I have a class name 'A' and this 'A class contains observable collections and other kind of objects. Therefore, when I feel i don't need to use the class anymore, for example leaving the page, I make that class 'A' object null. Is it a good practice to do or should I do something different?

gayan1991
  • 753
  • 2
  • 11
  • 35

1 Answers1

0

if your code is managed then just null the object, CLR will manage rest of the things. If your code is un-managed then implement IDsposable interface and call Dispose method.

Pratik
  • 267
  • 4
  • 16