mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
statically allocate midi-options
fixes possible segfault when the data in the vector goes out of scope due to RVO.
This commit is contained in:
parent
371bf59a94
commit
fb51bdb892
4 changed files with 18 additions and 10 deletions
|
|
@ -38,6 +38,7 @@ using namespace ARDOUR;
|
|||
|
||||
static std::string s_instance_name;
|
||||
size_t AlsaAudioBackend::_max_buffer_size = 8192;
|
||||
std::vector<std::string> AlsaAudioBackend::_midi_options;
|
||||
|
||||
AlsaAudioBackend::AlsaAudioBackend (AudioEngine& e, AudioBackendInfo& info)
|
||||
: AudioBackend (e, info)
|
||||
|
|
@ -403,11 +404,12 @@ AlsaAudioBackend::midi_device_info(std::string const name) const {
|
|||
std::vector<std::string>
|
||||
AlsaAudioBackend::enumerate_midi_options () const
|
||||
{
|
||||
std::vector<std::string> m;
|
||||
m.push_back (_("None"));
|
||||
m.push_back (_("ALSA raw devices"));
|
||||
m.push_back (_("ALSA sequencer"));
|
||||
return m;
|
||||
if (_midi_options.empty()) {
|
||||
_midi_options.push_back (_("None"));
|
||||
_midi_options.push_back (_("ALSA raw devices"));
|
||||
_midi_options.push_back (_("ALSA sequencer"));
|
||||
}
|
||||
return _midi_options;
|
||||
}
|
||||
|
||||
std::vector<AudioBackend::DeviceStatus>
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ class AlsaAudioBackend : public AudioBackend {
|
|||
bool _freewheeling;
|
||||
bool _measure_latency;
|
||||
|
||||
static std::vector<std::string> _midi_options;
|
||||
std::string _audio_device;
|
||||
std::string _midi_driver_option;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue