Skip to content

Commit

Permalink
Stop DataViewer::setTableModel from crashing when new model is same a…
Browse files Browse the repository at this point in the history
…s old one
  • Loading branch information
rparkins999 committed Dec 17, 2024
1 parent fc39c35 commit 9669df2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sqliteman/sqliteman/dataviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,9 @@ bool DataViewer::checkForPending()

bool DataViewer::setTableModel(QAbstractItemModel * model, bool showButtons)
{
if (!checkForPending()) { return false; }
QAbstractItemModel * old = ui.tableView->model();
if (old == model) { return true; } // Nothing to do, avoid SIGSEGV
if (!checkForPending()) { return false; }
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
showingChanges = false;
ui.tableView->setModel(model); // references old model
Expand Down

0 comments on commit 9669df2

Please sign in to comment.