stlehmann / pyads

Python wrapper for TwinCAT ADS
MIT License
255 stars 94 forks source link

Close pyads.Connection in destructor #178

Closed RobertoRoos closed 3 years ago

RobertoRoos commented 3 years ago

Mentioned this in #174, but I figured it deserves its own issue.

The Connection class currently does not have a destructor. I figured it might make sense to close it in __del__. If it's already closed it can't do any harm. Is there a reason this was not added?

stlehmann commented 3 years ago

I figured it might make sense to close it in del.

You mean to close the connection if the object is destroyed? This is a great idea. It think the main reason why it has not been added is because nobody thought of it, yet.

RobertoRoos commented 3 years ago

Lemme get a new PR rolling.