Hello!

I've got function in which I've got something like that:

Qt Code:
  1. void MainWindow::myFunction()
  2. {
  3. [...]
  4.  
  5. bool ok;
  6. QTextStream out(stdout);
  7.  
  8. QSqlDatabase bdb = QSqlDatabase::addDatabase("QSQLITE");
  9.  
  10. bdb.setDatabaseName(databaseName);
  11. ok = bdb.open();
  12.  
  13. if (ok)
  14. {
  15. out << endl << "Otworzylem baze!" << endl ;
  16. } else {
  17. out << "Nie udalo sie otworzyc bazy!" << endl;
  18. }
  19.  
  20. QSqlQueryModel *queryModel = new QSqlQueryModel;
  21.  
  22. queryModel->setQuery("SELECT * FROM config WHERE name='qt-notification-interval'", bdb);
  23.  
  24. rec = queryModel->record(0);
  25. notificationInterval = (rec.value(1).toInt())*1000;
  26.  
  27. out << notificationInterval << endl;
  28.  
  29. bdb.close();
  30.  
  31. [...]
  32. }
To copy to clipboard, switch view to plain text mode 

I invoke this function many times. Is it necessary to remove somehow from memory queryModel? Or is it removed automatically after exiting function?

thanks in advance
best regards
Tomasz