Skip to content

Commit 3fd4cc9

Browse files
committed
Clear waiting sounds on init
1 parent 3f4c47d commit 3fd4cc9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/blocks/soundblocks.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ void SoundBlocks::registerBlocks(IEngine *engine)
3333
engine->addInput(this, "VOLUME", VOLUME);
3434
}
3535

36+
void SoundBlocks::onInit(IEngine *engine)
37+
{
38+
m_waitingSounds.clear();
39+
// TODO: Remove stopped threads from m_waitingSounds
40+
}
41+
3642
bool SoundBlocks::compilePlayCommon(Compiler *compiler, bool untilDone, bool *byIndex)
3743
{
3844
Target *target = compiler->target();

src/blocks/soundblocks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class SoundBlocks : public IBlockSection
3636
std::string name() const override;
3737

3838
void registerBlocks(IEngine *engine) override;
39+
void onInit(IEngine *engine) override;
3940

4041
static bool compilePlayCommon(Compiler *compiler, bool untilDone, bool *byIndex = nullptr);
4142
static void compilePlay(Compiler *compiler);

0 commit comments

Comments
 (0)