diff --git a/include/FluidSCWrapper.hpp b/include/FluidSCWrapper.hpp index 6b530dc..2c4c1e0 100644 --- a/include/FluidSCWrapper.hpp +++ b/include/FluidSCWrapper.hpp @@ -276,6 +276,7 @@ public: // we want to poll thread roughly every 20ms checkThreadInterval = static_cast(0.02 / controlDur()); set_calc_function(); + Wrapper::getInterfaceTable()->fClearUnitOutputs(this, 1); }; /// The calc function. Checks to see if we've cancelled, spits out progress, @@ -452,7 +453,7 @@ private: protected: ParamSetType mParams; Client mClient; - bool mSynchronous{true}; + bool mSynchronous{false}; bool mQueueEnabled{false}; bool mCheckingForDone{false}; // only write to this from RT thread kthx bool mCancelled{false}; @@ -604,9 +605,11 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase { // first is string size, then chars index size = static_cast(args.next()); + + auto ft = FluidSCWrapper::getInterfaceTable(); + char* chunk = - static_cast(FluidSCWrapper::getInterfaceTable()->fRTAlloc( - w, asUnsigned(size + 1))); + static_cast(ft->fRTAlloc(w, asUnsigned(size + 1))); if (!chunk) { @@ -619,8 +622,9 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase chunk[i] = static_cast(args.next()); chunk[size] = 0; // terminate string - - return std::string{chunk}; + auto res = std::string{chunk}; + ft->fRTFree(w,chunk); + return res; }