From 0a580b60b1d4a5c2adf6fd9ccc5a3681d555d402 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 23 Jan 2022 12:52:55 +0000 Subject: [PATCH] Safer? git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3788 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ssb.c b/src/ssb.c index e4d59e69..916a463c 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -1223,9 +1223,10 @@ void tf_ssb_connection_destroy(tf_ssb_connection_t* connection) } if (!JS_IsUndefined(connection->object)) { - JS_SetOpaque(connection->object, NULL); - JS_FreeValue(ssb->context, connection->object); + JSValue object = connection->object; connection->object = JS_UNDEFINED; + JS_SetOpaque(object, NULL); + JS_FreeValue(ssb->context, object); } if (connection->async.data && !uv_is_closing((uv_handle_t*)&connection->async)) {