python-mpv-jsonipc icon indicating copy to clipboard operation
python-mpv-jsonipc copied to clipboard

Does __del__ ever actually get called?

Open EternityForest opened this issue 1 year ago • 0 comments

It seems like the socket thread holding a reference to the callback prevents del from being called, which means the thread never stops unless you manually call terminate() explicitly, and you get a thread leak.

And when you do call it explicitly, it sometimes stops with a nuisance error when the thread tries to read the closed socket. I work around that by changing the "while True" to "while self.should_run" and setting that to False to stop the loop before shutting down the socket and process.

EternityForest avatar Jun 10 '24 07:06 EternityForest