Fixed a potential threading problem in DTSC::Stream.

This commit is contained in:
Thulinma 2013-05-21 13:21:07 +02:00
parent f5cbe7343d
commit 62c4689ae2

View file

@ -189,6 +189,10 @@ std::string & DTSC::Stream::lastData(){
/// Returns the packet in this buffer number.
/// \arg num Buffer number.
JSON::Value & DTSC::Stream::getPacket(unsigned int num){
static JSON::Value empty;
if (num >= buffers.size()){
return empty;
}
return buffers[num];
}