G2.2: flush bridge state to disk before kill (control type=5 DUMP + Rust pre-kill)

This commit is contained in:
2026-08-16 07:52:01 +07:00
parent c2ae452844
commit d31312e824
4 changed files with 23 additions and 1 deletions
+3
View File
@@ -1289,6 +1289,9 @@ int main(int argc, char* argv[]) {
} else if (c.type == 4) { // OPEN_GUI (A7): arg1 = parent HWND (0 → bridge tự tạo native window), arg2 = plugin id
uint32_t guiCh = c.channel;
if (guiCh >= 16) guiCh = 0;
handleOpenGui(guiCh, (uintptr_t)c.arg1, std::string(c.arg2));
} else if (c.type == 5) { // DUMP_STATE (G2.2): Rust pre-kill flush
std::cout << "[NativeBridge] DUMP_STATE - flushing state now" << std::endl;
uiWorker.post([&]() { saveStateJob(); });
}
}