From debda7306890237b90bbbd0f7e60a16ef6b31e09 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Sat, 18 Apr 2026 16:43:19 +0200 Subject: [PATCH] webview-exit --- rktwebview.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rktwebview.cpp b/rktwebview.cpp index cf27219..60d492d 100644 --- a/rktwebview.cpp +++ b/rktwebview.cpp @@ -297,15 +297,19 @@ void rkt_webview_cleanup() // Cleaning up when exiting the current custodian is not enough. handler->verbose = true; - sleep_ms(3000); if (handler->valid) { - if (handler->evt_cb != nullptr) { + if (handler->guard_thread != nullptr) { + if (handler->evt_cb != nullptr) { + INFO0("Clearing evt_guard callback to null\n"); + handler->evt_cb = nullptr; + } else { + INFO0("evt_guard callback is already null\n"); + } INFO0("Stopping evt_guard (enqueuing evt_guard_stop)\n"); handler->event_queue->enqueue(EVT_GUARD_STOP); INFO0("yielding current thread and hopefully activating evt_guard thread\n"); YIELD(); - sleep_ms(1000); INFO0("joining guard thread\n"); handler->guard_thread->join(); INFO0("Deleting guard thread\n"); @@ -378,7 +382,7 @@ void rkt_webview_init() handler->name = buf; handler->function_calls = 0; handler->events = 0; - handler->verbose = true; + handler->verbose = false; handler->shm_size = SHM_SIZE; handler->shm = new Shm(handler->name.data(), handler->shm_size, true);