Skip to content

Commit

Permalink
Added copy of container to ranged loop so as to prevent crash
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Ariño Muñoz <[email protected]>
  • Loading branch information
Pabarino authored and backportbot[bot] committed Feb 25, 2025
1 parent ae22f90 commit 0b23015
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/ownsql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ QString SqlDatabase::error() const
void SqlDatabase::close()
{
if (_db) {
for (const auto q : std::as_const(_queries)) {
const auto queries = _queries;
for (const auto q : queries) {
q->finish();
}
SQLITE_DO(sqlite3_close(_db));
Expand Down

0 comments on commit 0b23015

Please sign in to comment.