mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
fix memory leak
This commit is contained in:
@@ -139,6 +139,17 @@ void MainWindow::init()
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::clearCompleterModelsFields()
|
||||
{
|
||||
for(SqlTextEdit::FieldCompleterModelMap::iterator it = completerModelsFields.begin();
|
||||
it != completerModelsFields.end();
|
||||
++it)
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
completerModelsFields.clear();
|
||||
}
|
||||
|
||||
bool MainWindow::fileOpen(const QString& fileName)
|
||||
{
|
||||
bool retval = false;
|
||||
@@ -200,7 +211,7 @@ void MainWindow::fileNew()
|
||||
void MainWindow::populateStructure()
|
||||
{
|
||||
completerModelTables.clear();
|
||||
completerModelsFields.clear();
|
||||
clearCompleterModelsFields();
|
||||
if(!db.isOpen())
|
||||
return;
|
||||
|
||||
@@ -350,6 +361,7 @@ void MainWindow::closeEvent( QCloseEvent* event )
|
||||
PreferencesDialog::setSettingsValue("MainWindow", "geometry", saveGeometry());
|
||||
PreferencesDialog::setSettingsValue("MainWindow", "windowState", saveState());
|
||||
PreferencesDialog::setSettingsValue("SQLLogDock", "Log", ui->comboLogSubmittedBy->currentText());
|
||||
clearCompleterModelsFields();
|
||||
QMainWindow::closeEvent(event);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ private:
|
||||
QNetworkAccessManager* m_NetworkManager;
|
||||
|
||||
void init();
|
||||
void clearCompleterModelsFields();
|
||||
|
||||
void updateRecentFileActions();
|
||||
void setCurrentFile(const QString& fileName);
|
||||
|
||||
Reference in New Issue
Block a user