Fix for an error when closing PyDM displays. The error occurs when closing a PyDM application and a PyDMChannel attempts to close its connections. Somehow the connections are already deleted before PyDMChannel can delete them explicitly.
Error text example:
[2024-06-26 14:13:39,082] [ERROR ] - Unable to remove connection for <PyDMChannel (archiver://pv=KLYS:LI22:31:KVAC)>
Traceback (most recent call last):
File "/afs/slac.stanford.edu/u/cd/zdomke/workspace/pydm/pydm/widgets/channel.py", line 164, in disconnect
plugin.remove_connection(self, destroying=destroying)
File "/afs/slac.stanford.edu/u/cd/zdomke/workspace/pydm/pydm/data_plugins/plugin.py", line 320, in remove_connection
self.connections[connection_id].deleteLater()
RuntimeError: wrapped C/C++ object of type Connection has been deleted
The solution is to check if the connections are already closed using PyQT.sip.isdeleted()
I'm really happy you managed to track this one down, I've seen this before but not known what it was or how to coherently report/investigate the issue.
Fix for an error when closing PyDM displays. The error occurs when closing a PyDM application and a PyDMChannel attempts to close its connections. Somehow the connections are already deleted before PyDMChannel can delete them explicitly.
Error text example: [2024-06-26 14:13:39,082] [ERROR ] - Unable to remove connection for <PyDMChannel (archiver://pv=KLYS:LI22:31:KVAC)> Traceback (most recent call last): File "/afs/slac.stanford.edu/u/cd/zdomke/workspace/pydm/pydm/widgets/channel.py", line 164, in disconnect plugin.remove_connection(self, destroying=destroying) File "/afs/slac.stanford.edu/u/cd/zdomke/workspace/pydm/pydm/data_plugins/plugin.py", line 320, in remove_connection self.connections[connection_id].deleteLater() RuntimeError: wrapped C/C++ object of type Connection has been deleted
The solution is to check if the connections are already closed using PyQT.sip.isdeleted()