mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Fix crash when exporting SQL files
Exporting SQL files crashed because of the multi-threaded loading of data which also affects the SQL export. Because the table models were destructed relatively quickly during the export's progress estimation, their threads were still running and trying to access invalid data structures. See issue #1228.
This commit is contained in:
@@ -22,6 +22,12 @@ SqliteTableModel::SqliteTableModel(DBBrowserDB& db, QObject* parent, size_t chun
|
||||
reset();
|
||||
}
|
||||
|
||||
SqliteTableModel::~SqliteTableModel()
|
||||
{
|
||||
m_futureFetch.cancel();
|
||||
m_futureFetch.waitForFinished();
|
||||
}
|
||||
|
||||
void SqliteTableModel::reset()
|
||||
{
|
||||
m_futureFetch.cancel();
|
||||
|
||||
@@ -20,6 +20,7 @@ class SqliteTableModel : public QAbstractTableModel
|
||||
|
||||
public:
|
||||
explicit SqliteTableModel(DBBrowserDB& db, QObject *parent = nullptr, size_t chunkSize = 50000, const QString& encoding = QString());
|
||||
~SqliteTableModel();
|
||||
void reset();
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
Reference in New Issue
Block a user