Browse Source

MT#56447 simplify handle removal

No need to do the key lookup twice.

Change-Id: Icb940d456656829d8c804773235d7ec20b76df65
pull/1642/head
Richard Fuchs 3 years ago
parent
commit
baa617e446
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      daemon/janus.c

+ 1
- 3
daemon/janus.c View File

@ -1329,13 +1329,11 @@ const char *janus_detach(struct websocket_message *wm, JsonReader *reader, JsonB
{
LOCK(&session->lock);
void *exists = g_hash_table_lookup(session->handles, &handle_id);
bool exists = g_hash_table_remove(session->handles, &handle_id);
*retcode = 463;
if (!exists)
return "Could not detach handle from plugin";
g_hash_table_remove(session->handles, &handle_id);
}
LOCK(&janus_lock);


Loading…
Cancel
Save