MainWindow: Fix crash on closing last session
[pulseview.git] / pv / mainwindow.cpp
index 787e1acf96dfc9bc7a0e372001f5118e68025a85..a8f093bccd6eb051c533452b3e86b490625b2bff 100644 (file)
@@ -163,7 +163,7 @@ shared_ptr<pv::view::View> MainWindow::get_active_view() const
                if (entry.first.get() == dock)
                        return entry.second;
 
-       return shared_ptr<pv::view::View>();
+       return nullptr;
 }
 
 shared_ptr<pv::view::View> MainWindow::add_view(const QString &title,
@@ -260,7 +260,7 @@ void MainWindow::remove_session(shared_ptr<Session> session)
        // Update the window title if there is no view left to
        // generate focus change events
        if (sessions_.empty())
-               on_session_name_changed();
+               setWindowTitle(WindowTitle);
 }
 
 void MainWindow::setup_ui()