diff --git a/tools/chatgui/transport/chat_sync.c b/tools/chatgui/transport/chat_sync.c index b165a3b3..e32289fa 100644 --- a/tools/chatgui/transport/chat_sync.c +++ b/tools/chatgui/transport/chat_sync.c @@ -199,7 +199,7 @@ static void ac_result_cb(int result, uint64_t node_id, void* arg) { if (!g_ac || !g_ac->active) return; const char* rs = result == CONN_MGR_OK ? "OK" : "FAIL"; DEBUG_INFO(DEBUG_CATEGORY_CONNECTIVITY, "%s: result node=0x%016llx %s", AC_ID, (unsigned long long)node_id, rs); - /* DON'T clear ca_state — GC will close connection and free slot after AC_GC_TIMEOUT_MS */ + if (result == CONN_MGR_OK) f->ca_state = NULL; /* already freed by ca_ready_cb, prevent double-free in GC/stop */ } /* ── retry timer callback (every AC_RETRY_MS) ── */