--- pv/mainwindow.cpp | 13 ++++++++----- pv/view/view.cpp | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index f7c4712..9e82fc8 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -269,8 +269,8 @@ void MainWindow::remove_session(shared_ptr<Session> session) for (shared_ptr<views::ViewBase> view : session->views()) { // Find the dock the view is contained in and remove it - for (auto entry : view_docks_) - if (entry.second == view) { + for (auto it = view_docks_.begin(); it != view_docks_.end(); ) + if (it->second == view) { // Remove the view from the session session->deregister_view(view); @@ -278,10 +278,13 @@ void MainWindow::remove_session(shared_ptr<Session> session) // call deleteLater() on it, which causes a double free // since the shared_ptr in view_docks_ doesn't know // that Qt keeps a pointer to the view around - entry.second->setParent(0); + it->second->setParent(0); - // Remove this entry from the container - view_docks_.erase(entry.first); + // Remove this entry from the container; iterator will point to + // the one coming up after it + it = view_docks_.erase(it); + } else { + ++it; } } diff --git a/pv/view/view.cpp b/pv/view/view.cpp index a086d23..9751f00 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -155,7 +155,8 @@ View::View(Session &session, QWidget *parent) : cursors_(new CursorPair(*this)), next_flag_text_('A'), trigger_markers_(), - hover_point_(-1, -1) + hover_point_(-1, -1), + scroll_needs_defaults(false) { connect(scrollarea_.horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(h_scroll_value_changed(int))); -- 2.5.5 ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/intel _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel