Fixed a potential threading problem in DTSC::Stream.
This commit is contained in:
parent
f5cbe7343d
commit
62c4689ae2
1 changed files with 4 additions and 0 deletions
|
@ -189,6 +189,10 @@ std::string & DTSC::Stream::lastData(){
|
||||||
/// Returns the packet in this buffer number.
|
/// Returns the packet in this buffer number.
|
||||||
/// \arg num Buffer number.
|
/// \arg num Buffer number.
|
||||||
JSON::Value & DTSC::Stream::getPacket(unsigned int num){
|
JSON::Value & DTSC::Stream::getPacket(unsigned int num){
|
||||||
|
static JSON::Value empty;
|
||||||
|
if (num >= buffers.size()){
|
||||||
|
return empty;
|
||||||
|
}
|
||||||
return buffers[num];
|
return buffers[num];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue