@@ -311,8 +311,10 @@ std::tuple<ConnThread, bool> SetThread(GuardedRef<ConnThreads> threads, Connecti
311
311
if (thread != threads.ref .end ()) return {thread, false };
312
312
thread = threads.ref .emplace (
313
313
std::piecewise_construct, std::forward_as_tuple (connection),
314
- std::forward_as_tuple (make_thread (), connection, /* destroy_connection= */ false )).first ;
315
- thread->second .setDisconnectCallback ([threads, thread] {
314
+ std::forward_as_tuple ()
315
+ ).first ;
316
+ thread->second .emplace (make_thread (), connection, /* destroy_connection= */ false );
317
+ thread->second ->setDisconnectCallback ([threads, thread] {
316
318
// Note: it is safe to use the `thread` iterator in this cleanup
317
319
// function, because the iterator would only be invalid if the map entry
318
320
// was removed, and if the map entry is removed the ProxyClient<Thread>
@@ -323,7 +325,7 @@ std::tuple<ConnThread, bool> SetThread(GuardedRef<ConnThreads> threads, Connecti
323
325
// try to unregister this callback after connection is destroyed.
324
326
// Remove connection pointer about to be destroyed from the map
325
327
const Lock lock (threads.mutex );
326
- thread->second . m_disconnect_cb .reset ();
328
+ thread->second -> m_disconnect_cb .reset ();
327
329
threads.ref .erase (thread);
328
330
});
329
331
return {thread, true };
0 commit comments