Skip to content

Commit

Permalink
Handle memoryWarningReceived() message from AUv3 hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Dec 3, 2023
1 parent 2f2dd7f commit 9b5c24e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/BYOD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ void BYOD::prepareToPlay (double sampleRate, int samplesPerBlock)
bypassScratchBuffer.setSize (2, samplesPerBlock);
}

void BYOD::memoryWarningReceived()
{
const MessageManagerLock mml {};
undoManager.clearUndoHistory();
}

void BYOD::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midi)
{
TRACE_DSP();
Expand Down
1 change: 1 addition & 0 deletions src/BYOD.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class BYOD : public chowdsp::PluginBase<BYOD>

void getStateInformation (MemoryBlock& destData) override;
void setStateInformation (const void* data, int sizeInBytes) override;
void memoryWarningReceived() override;

auto& getProcChain() { return *procs; }
auto& getVTS() { return vts; }
Expand Down

0 comments on commit 9b5c24e

Please sign in to comment.