[PATCH 2/3] redraw profile (actually clean it) if no dive is selected

me at bearsh.org me at bearsh.org
Sat Dec 7 04:25:17 UTC 2013


From: Martin Gysel <me at bearsh.org>

otherwise the previous selected dive is still visible in the profile
view. clicking on edit crashs subsurface: null pointer dereference in
editCurrentDive as it uses 'current_dive' which is null.

Signed-off-by: Martin Gysel <me at bearsh.org>
---
 qt-ui/mainwindow.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index e456991..78868e6 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -86,8 +86,8 @@ void MainWindow::current_dive_changed(int divenr)
 	if (divenr >= 0) {
 		select_dive(divenr);
 		ui.globe->centerOn(get_dive(selected_dive));
-		redrawProfile();
 	}
+	redrawProfile();
 	ui.InfoWidget->updateDiveInfo(divenr);
 }
 
-- 
1.8.5.1



More information about the subsurface mailing list