NISystemsEngineering / LabVIEW-Modbus-API

63 stars 37 forks source link

TCP Slave Remove Connections Memory Leak #3

Closed jacobson3 closed 5 years ago

jacobson3 commented 5 years ago

In TCP Slave.lvclass:Remove Unused Connections.vi we remove Connection Records which are no longer "Connected?" but we never close any of these Connection Records references. This leads to a very slow memory leak if using the TCP Slave API when masters continually connected and reconnect. We should do something similar to what is shown below so we don't leak DVR references.

remove connections

smithed commented 5 years ago

Woops. The fix is as simple as shown, except that the delete should be outside of the IPE structure. Otherwise you are deleting mutexes inside of a mutex which just seems iffy.