Skip to main content

install_gc_sentinel

Function install_gc_sentinel 

Source
pub fn install_gc_sentinel(engine: Pin<&mut QQmlApplicationEngine>)
Expand description

Arms the automatic collection trigger on engine by creating a sentinel.

The sentinel is a dummy QObject with JavaScriptOwnership whose JS wrapper is referenced by nothing: the next garbage collection frees the wrapper and thereby deletes the sentinel, whose destroyed() signal runs collect_garbage and re-arms a new sentinel one event-loop turn later. crate::QApp arms this automatically; call it manually when driving a raw engine.