PCloudStimBuff: Call stop=>start in destroyAttachedStimBuff
This ensures that we can avoid races when adding and removing stimbuffs to a stimproducer. At least in theory. I can think of some ways in which this current design may result in races or other bad conditions.
This commit is contained in:
@@ -210,6 +210,8 @@ void PcloudStimulusProducer::destroyAttachedStimulusBuffer(
|
||||
{
|
||||
if (!buffer) { return; }
|
||||
|
||||
this->stop();
|
||||
|
||||
// Clear specialized buffer pointers if they match
|
||||
if (meshStimulusBuffer == buffer)
|
||||
{ meshStimulusBuffer.reset(); }
|
||||
@@ -220,6 +222,8 @@ void PcloudStimulusProducer::destroyAttachedStimulusBuffer(
|
||||
|
||||
// Call base class implementation to remove from attachedStimulusBuffers
|
||||
StimulusProducer::destroyAttachedStimulusBuffer(buffer);
|
||||
|
||||
this->start();
|
||||
}
|
||||
|
||||
std::shared_ptr<StimulusBuffer>
|
||||
|
||||
Reference in New Issue
Block a user