Rank: Advanced Member Groups: Member
Joined: 10/7/2015 Posts: 35
|
I was just wanting advice on which method to use when disposing a webview object - webview.Destroy() or webview.Dispose or both?
I have some code which uses webview.Destroy() which seems to dispose correctly. But I have seen code on the forum here, that uses both. Is Destroy() a wrapper that calls Dispose() anyway?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Hi,
They are close but they are not exactly the same. WebView inherits from Component so it inherits the Component class's Dispose implementation, which does things related to Component. For example, it would remove the component from it's Container.
Component's Dispose also triggers Disposed event. WebView handles this event and calls Destroy.
Thanks!
|