mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-14 01:10:11 -05:00
Rollback to Alex's original changes to _synchronizationBuffer
Allocated _synchronizationBuffer in SyncBuffer initialization instead to fix.
This commit is contained in:
@@ -34,18 +34,19 @@ SyncBuffer::SyncBuffer(size_t n)
|
||||
, _decodeOffset(0)
|
||||
{
|
||||
_dataStream.resize(_n);
|
||||
_synchronizationBuffer = new sgct::SharedVector<char>();
|
||||
}
|
||||
|
||||
void SyncBuffer::write() {
|
||||
_synchronizationBuffer.setVal(_dataStream);
|
||||
sgct::SharedData::instance()->writeVector(&_synchronizationBuffer);
|
||||
_synchronizationBuffer->setVal(_dataStream);
|
||||
sgct::SharedData::instance()->writeVector(_synchronizationBuffer);
|
||||
_encodeOffset = 0;
|
||||
_decodeOffset = 0;
|
||||
}
|
||||
|
||||
void SyncBuffer::read() {
|
||||
sgct::SharedData::instance()->readVector(&_synchronizationBuffer);
|
||||
_dataStream = std::move(_synchronizationBuffer.getVal());
|
||||
sgct::SharedData::instance()->readVector(_synchronizationBuffer);
|
||||
_dataStream = std::move(_synchronizationBuffer->getVal());
|
||||
_encodeOffset = 0;
|
||||
_decodeOffset = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user