Hello...I have question about thread. Why we have to dispose our thread? What happened if we don't do it? Can I only dispose() method to dispose my thread?

Thanx:)

Recommended Answers

All 2 Replies

Huh? What are talking about. Thread has no dispose method. GUI elements normally do, but that is something different. Those you have to call because some elements are held onto (i.e. referred to from somewhere) even after all your references have gone out of scope, and some information is sometimes held onto even after you remove them from the GUI. dispose will remove those references, thereby allowing the info to be garbage collected. Threads you simply let run out of scope, or, if the scope is going to continue long after the thread has been created, and long after the thread has finished its work, then set your reference to it to null.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.