spacr._gc

Explicit pipeline cleanup without destroying GUI objects on workers.

Functions

collect(→ int)

Collect now, or request a full sweep on the GUI's next timer tick.

Module Contents

spacr._gc.collect() → int[source]

Collect now, or request a full sweep on the GUI’s next timer tick.

Worker sweeps can destroy unrelated Qt widgets on the wrong thread. A running GUI therefore services worker requests through spacr.qt.gc_policy.collect_once(). Repeated requests coalesce. Headless processes and the GUI thread retain synchronous collection; checking for an application does not import Qt into headless jobs.

Returns:

unreachable objects collected, or zero for a deferred request.