Files
logos-protocol/cpp
Dario LipicarandClaude Opus 5 9664ae219d feat(abi): an optional teardown pair on the module C ABI (#62)
A module has no way to finish work before it is torn down. The host stops it,
its destructors run, and anything mid-flight is simply gone. This adds the two
symbols that let a module say "not yet" and then "done":

    int  logos_module_about_to_unload(void);
    void logos_module_set_unload_done_callback(cb, user_data);

Returning 1 buys a BOUNDED grace period, not a veto. A module that never
signals delays every teardown by that period and is torn down anyway, so the
deadline is real rather than a courtesy -- said in the header, because the
alternative is authors discovering it from a shutdown that got slower.

OPTIONAL, and that is load-bearing rather than politeness. The glue that calls
these is generated alongside the module, so a cdylib built before they existed
exports neither and its glue emits no calls: an older module keeps exactly the
teardown it always had, with no version negotiation and no new failure mode.

Header-only; no implementation and no behaviour change in this repo. The
emitters live in logos-cpp-sdk (C++ exports) and logos-plugin-qt (the Qt glue
that reaches them), and the host-side wait in logos-module-loader-qt.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 19:17:58 -03:00
..