don't take temporary copy of MIDI sequence

fixes potential boost shared_ptr double free.
This commit is contained in:
Robin Gareus 2014-12-31 03:12:57 +01:00
parent 2c8babf41e
commit f499f4cfd2
4 changed files with 11 additions and 11 deletions

View file

@ -142,7 +142,7 @@ class AlsaMidiPort : public AlsaPort {
DataType type () const { return DataType::MIDI; };
void* get_buffer (pframes_t nframes);
const AlsaMidiBuffer const_buffer () const { return _buffer[_bufperiod]; }
const AlsaMidiBuffer * const_buffer () const { return & _buffer[_bufperiod]; }
void next_period() { if (_n_periods > 1) { get_buffer(0); _bufperiod = (_bufperiod + 1) % _n_periods; } }
void set_n_periods(int n) { if (n > 0 && n < 3) { _n_periods = n; } }