quamotion / remoteviewing

RemoteViewing is a .NET-native VNC client and server library.
Other
261 stars 79 forks source link

VncControl do not release memory after calling Dispose() #167

Closed TonyTechLab closed 1 year ago

TonyTechLab commented 1 year ago

VncControl do not release memory after calling Dispose()

This lead to over memory use if the control is created and then dispose multi times during the application is running.

Look like it is not an issue of my code (remaining reference etc..) because i tested with other controls using the same logic and they all release the memory after calling the dispose() function .

Exept this remark, this control is the best i have found for c#. Thank you for the nice work!

TonyTechLab commented 1 year ago

I closed it because i have found that when i force the VncControl to be replaced by null into the chiild of the WinFormsHost control it release the memory so my issue was not real. Sorry for openning it wrongly.

ViewerVnc.HandleCreated -= OnHandleCreated; ViewerVnc.Connected -= OnConnected; ViewerVnc.Closed -= OnClosed; ViewerVnc.ConnectionFailed -= OnConnectionFailed; ViewerVnc.Client.Dispose(); ViewerVnc.Dispose(); ViewerVnc = null;

WinFormsHost.Child = null;