Guard against scsynth triggering u_cmd before constructor called

nix
Owen Green 6 years ago
parent c64f8eba3f
commit 1a01e76001

@ -1213,6 +1213,12 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
using IndexList = using IndexList =
typename Client::MessageSetType::template MessageDescriptorAt< typename Client::MessageSetType::template MessageDescriptorAt<
N>::IndexList; N>::IndexList;
if(!x->init)
{
std::cout << "ERROR: Synth constructor not yet called" << std::endl;
return;
}
launchMessageImpl<N>(x, args, IndexList()); launchMessageImpl<N>(x, args, IndexList());
} }
@ -1421,6 +1427,7 @@ class FluidSCWrapper : public impl::FluidSCWrapperBase<C>
<< std::endl; << std::endl;
} }
bool init{false};
public: public:
using Client = C; using Client = C;
@ -1432,6 +1439,7 @@ public:
{ {
client().setParams(params()); //<-IMPORTANT: client's ref to params is by address, and this has just changed client().setParams(params()); //<-IMPORTANT: client's ref to params is by address, and this has just changed
impl::FluidSCWrapperBase<Client>::init(); impl::FluidSCWrapperBase<Client>::init();
init = true;
} }
~FluidSCWrapper() ~FluidSCWrapper()

Loading…
Cancel
Save