From 021fc1d91724a34c533b17110c54cd61fa45da24 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Thu, 25 Jul 2019 11:09:24 +0100 Subject: [PATCH] Run Unit doneAction once everything is tidied away --- include/FluidSCWrapper.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index ac624e9..3adea8a 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -170,6 +170,7 @@ public: , mParams{Wrapper::Client::getParameterDescriptors()} , mClient{Wrapper::setParams(mParams,mWorld->mVerbosity > 0, mWorld, mControlsIterator,true)} {} + /// No option of not using a worker thread for now /// init() sets up the NRT process via the SC NRT thread, and then sets our UGen calc function going @@ -235,10 +236,11 @@ public: static bool tidyUp(World *world, void *data) { return static_cast(data)->tidyUp(world); } /// Now we're actually properly done, call the UGen's done action (possibly destroying this instance) - static void destroy(World *, void *data) + static void destroy(World *world, void *data) { auto w = static_cast(data); - w->mWorld->ft->fDoneAction(static_cast(w->mInBuf[w->mNumInputs - 1][0]),w); + int doneAction = static_cast(w->in0(static_cast(w->mNumInputs - 1))); + world->ft->fDoneAction(doneAction,w); } private: