VST3: Fix MSVC related crashes

Do not simply allocate std::vector<> space but also initialize
elements. The data is later accessed as C-pointer array: &var[0].
With most compilers simply reserving space in the vector is
sufficient in order to later access the elements directly.
However actually placing objects in the vector before referencing
them is more correct.
This commit is contained in:
Robin Gareus
2021-03-02 19:05:58 +01:00
parent e81794d878
commit cb0b152b35

View File

@@ -1077,8 +1077,8 @@ VST3PI::VST3PI (boost::shared_ptr<ARDOUR::VST3PluginModule> m, std::string uniqu
_n_bus_in = _component->getBusCount (Vst::kAudio, Vst::kInput);
_n_bus_out = _component->getBusCount (Vst::kAudio, Vst::kOutput);
_busbuf_in.reserve (_n_bus_in);
_busbuf_out.reserve (_n_bus_out);
_busbuf_in.resize (_n_bus_in);
_busbuf_out.resize (_n_bus_out);
/* do not re-order, _io_name is build in sequence */
_n_inputs = count_channels (Vst::kAudio, Vst::kInput, Vst::kMain);