Rebind ticket editor before releasing preview providers (by Codex)

This commit is contained in:
Codex committed 2026-10-29 06:30:31 +01:00
1 parent 0edf208405
commit 5a9121b872
4 files changed
+30 -1

No files matched your search

+5 -1
View File
@@ -7,7 +7,10 @@ void App::engine_finance_submit(const Json &command) {
}, true);
}
void App::engine_ticket_bind() {
if (ticket_) return;
if (ticket_ && ticket_engine_bound_) return;
// A preview editor captures its DataSource by reference. Destroy it while
// that provider still exists, before the career handoff releases the source.
ticket_.reset();
ticket_ = std::make_unique<TicketPopover>(*context_, *doc_, [this] {
Json state;
if (engine_fresh_ && !engine_busy_) {
@@ -22,6 +25,7 @@ void App::engine_ticket_bind() {
return ActionResult{true, input_revision(), {}};
} catch (const std::exception &e) { return ActionResult{false, input_revision(), e.what()}; }
}, [this] { focus_after_render_ = "account-ticket"; dirty_ = true; });
ticket_engine_bound_ = true;
}
bool App::engine_bank_action(const std::string &action, Rml::Element *target) {
if (!engine_fresh_ || engine_busy_) return true;