mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-26 15:21:19 -05:00
* Bound Plugin Disconnect and Python Shutdown When OrcaSlicer Exits A Python printer agent whose disconnect_printer() never returned froze the closing app, and a plugin thread that never ended kept the process alive after its window closed, because Py_Finalize joins every non-daemon thread. At shutdown a Python agent's disconnect_printer() now runs once per agent on a helper thread with a 3 second deadline, holding a reference that keeps the plugin object alive if the call outlives a forced unload. PythonInterpreter::shutdown() waits up to 3 seconds for running plugin calls and for non-daemon threads; if either is still going, the interpreter is left unfinalized for the process exit to end. * Run the Threading Atexit Hooks Before Waiting for Plugin Threads An idle concurrent.futures worker only ends when the hooks registered with threading._register_atexit() tell it to, and Py_Finalize runs those after the shutdown wait, so a plugin that left an executor open made every exit wait the full deadline and skip finalization. The hooks now run first, on a daemon thread joined within the same deadline, since they join their workers without a timeout.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: