diff options
author | David Robillard <d@drobilla.net> | 2013-01-19 07:00:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-19 07:00:43 +0000 |
commit | fc77ae0738565770abde1a25f650a035cf082af0 (patch) | |
tree | f4edb7bcdcddf186fcf5cf4fb033e602580e4008 /gtk2_ardour/midi_channel_selector.cc | |
parent | d251c68d7676a18ab9ed935e22558e2b18981b41 (diff) |
Replace a bunch of potential crashes with graceful handling of the situation.
We really need some kind of more sophisticated assert macro that can be
switched to non-fatal logging mode for release builds. A log message, which is
often all that would happen, is a lot better than a trainwrecked performance...
git-svn-id: svn://localhost/ardour2/branches/3.0@13892 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_channel_selector.cc')
-rw-r--r-- | gtk2_ardour/midi_channel_selector.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/midi_channel_selector.cc b/gtk2_ardour/midi_channel_selector.cc index cdaf42e51f..6770f0e60d 100644 --- a/gtk2_ardour/midi_channel_selector.cc +++ b/gtk2_ardour/midi_channel_selector.cc @@ -17,7 +17,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <algorithm> #include <sstream> + #include "midi_channel_selector.h" #include "gtkmm/separator.h" #include "i18n.h" @@ -31,10 +33,10 @@ MidiChannelSelector::MidiChannelSelector(int n_rows, int n_columns, int start_ro : Table(n_rows, n_columns, true) , _recursion_counter(0) { - assert(n_rows >= 4); - assert(n_rows >= start_row + 4); - assert(n_columns >=4); - assert(n_columns >= start_column + 4); + n_rows = std::max(4, n_rows); + n_rows = std::max(4, start_row + 4); + n_columns = std::max(4, n_columns); + n_columns = std::max(4, start_column + 4); property_column_spacing() = 0; property_row_spacing() = 0; |