Skip to content

Commit e533b41

Browse files
committed
Fix hang when using a remote server (was working only with embedded)
1 parent c5097cb commit e533b41

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/lib/EventListener.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,17 @@ void EventListener::handleEvent(unsigned length, const std::uint8_t* events)
271271
return;
272272
}
273273

274-
std::lock_guard mutexGuard{mutex};
274+
FbRef<fb::IEvents> previousHandle;
275+
276+
{
277+
std::lock_guard mutexGuard{mutex};
275278

276-
if (listening)
277-
eventsHandle = std::move(newHandle);
279+
if (listening)
280+
{
281+
previousHandle = std::move(eventsHandle);
282+
eventsHandle = std::move(newHandle);
283+
}
284+
}
278285
}
279286

280287
void EventListener::dispatchLoop()

0 commit comments

Comments
 (0)