mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-09 05:00:42 -06:00
Rollback to Alex's original changes to _synchronizationBuffer
Allocated _synchronizationBuffer in SyncBuffer initialization instead to fix.
This commit is contained in:
@@ -107,7 +107,7 @@ private:
|
||||
size_t _encodeOffset;
|
||||
size_t _decodeOffset;
|
||||
std::vector<char> _dataStream;
|
||||
sgct::SharedVector<char> _synchronizationBuffer;
|
||||
sgct::SharedVector<char>* _synchronizationBuffer;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -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