How do I deal with “Internal C++ object (some object) already deleted”?
When I close a window which has a logger and then re-open the window, I get “RuntimeError: Internal C++ object (PySide6.QtWidgets.QPlainTextEdit) already deleted.”(I made the logger based off of this post: Best way to display logs in pyqt?).
When I remove “self.deleteLater()” from LoggerWindow’s closeEvent, I don’t get the error since QWidget is not deleted. But the problem is that in my program, I need “self.deleteLater()” to detect that the window is closed (using self.(QWidget).destroyed.connect()).
Is there any way to avoid this error, or is there a different way to detect when a window closes?