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:
2025-11-20 02:18:25 -04:00
parent 1bf0a195aa
commit 9d9644cb31
@@ -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>