I'm having an issue with a GUI plugin (
this one). Every time I open the plugin main window, a new instance of the plugin is created. This may lead to a memory leak, but there's also the problem that I'm connected a selectionChanged signal to some plugin method, and this connection remains even after I have closed the plugin.
So, how can I completely destroy the plugin instance (and all its connections) when the main plugin window is closed (either with the "Cancel" button or with "x" window button)?
EDIT: This seems to do it:
Code:
from PyQt4.Qt import Qt
self.setAttribute(Qt.WA_DeleteOnClose)