Commit 5abeb810 authored by Jussi Lindgren's avatar Jussi Lindgren

Server: Fixed issue on scheduling buffers to a client that has quit

parent 6c1867ad
......@@ -214,6 +214,8 @@ namespace OpenViBEAcquisitionServer
}
oLock.lock();
// We're done, clean any possible pending buffers
for(auto it = m_vClientPendingBuffer.begin(); it!=m_vClientPendingBuffer.end(); it++)
{
......@@ -221,19 +223,23 @@ namespace OpenViBEAcquisitionServer
}
m_vClientPendingBuffer.clear();
oLock.unlock();
// The thread will exit here and can be joined
}
void scheduleBuffer(const IMemoryBuffer& rMemoryBuffer)
{
CMemoryBuffer* l_pMemoryBuffer=new CMemoryBuffer(rMemoryBuffer);
{
std::lock_guard<std::mutex> oLock(m_oClientThreadMutex);
m_vClientPendingBuffer.push_back(l_pMemoryBuffer);
if(!m_bPleaseQuit)
{
CMemoryBuffer* l_pMemoryBuffer=new CMemoryBuffer(rMemoryBuffer);
m_vClientPendingBuffer.push_back(l_pMemoryBuffer);
}
}
// No big harm notifying in any case, though if in 'quit' state, the quit request has already notified
m_oPendingBufferCondition.notify_one();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment