diff options
author | Carl Hetherington <carl@carlh.net> | 2009-08-24 18:20:10 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-08-24 18:20:10 +0000 |
commit | cee3c427d7a0fe1560218e954d467bc6e044db63 (patch) | |
tree | 00c46d85144e28b06f794ac25a626783bf672d8b /gtk2_ardour/region_selection.cc | |
parent | f9e30c4c086bde46e6cb705fa732b91a808d4b1e (diff) |
Reorder initialisation to prevent access to an uninitialised variable.
git-svn-id: svn://localhost/ardour2/branches/3.0@5579 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/region_selection.cc')
-rw-r--r-- | gtk2_ardour/region_selection.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk2_ardour/region_selection.cc b/gtk2_ardour/region_selection.cc index 13e2bdb7f4..59d74d933f 100644 --- a/gtk2_ardour/region_selection.cc +++ b/gtk2_ardour/region_selection.cc @@ -48,11 +48,12 @@ RegionSelection::RegionSelection (const RegionSelection& other) { RegionView::RegionViewGoingAway.connect (mem_fun(*this, &RegionSelection::remove_it)); + _current_start = other._current_start; + _current_end = other._current_end; + for (RegionSelection::const_iterator i = other.begin(); i != other.end(); ++i) { add (*i); } - _current_start = other._current_start; - _current_end = other._current_end; } /** operator= to set a RegionSelection to be the same as another. @@ -65,12 +66,12 @@ RegionSelection::operator= (const RegionSelection& other) clear_all(); + _current_start = other._current_start; + _current_end = other._current_end; + for (RegionSelection::const_iterator i = other.begin(); i != other.end(); ++i) { add (*i); } - - _current_start = other._current_start; - _current_end = other._current_end; } return *this; |