mirror of
https://github.com/fltk/fltk.git
synced 2026-05-20 04:31:25 +08:00
Fix Fl_Table_Row inconsistencies, final part (#1187)
Adjust internal vector sizes before and after changing the rows() in the base class to avoid inconsisten sizes. Note that the crash reported by the OP of PR #1187 was caused by more than one issue, not only the one fixed here. Thanks for the original patch to the author, GitHub user 'basiliscos'.
This commit is contained in:
@@ -203,8 +203,8 @@ void Fl_Table_Row::select_all_rows(int flag) {
|
||||
|
||||
// Set number of rows
|
||||
void Fl_Table_Row::rows(int val) {
|
||||
Fl_Table::rows(val);
|
||||
while ( val > (int)_rowselect.size() ) { _rowselect.push_back(0); } // enlarge
|
||||
Fl_Table::rows(val);
|
||||
while ( val < (int)_rowselect.size() ) { _rowselect.pop_back(); } // shrink
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user