Browse Source

fix(History): Deep copy QByteArrays from SQL selects

We already deep copy all other data types. Especially with Qt types like
QByteArray, having a deep copy to start is important since it shallow
copies on any subsequent copy, so the callback provider only gets a
shallow copy in the QByteArray of the temporary data from SQLite.
reviewable/pr6586/r1
Anthony Bilinski 3 years ago
parent
commit
27f19ec2fa
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
  1. 2
      src/persistence/db/rawdatabase.cpp

2
src/persistence/db/rawdatabase.cpp

@ -905,7 +905,7 @@ QVariant RawDatabase::extractData(sqlite3_stmt* stmt, int col) @@ -905,7 +905,7 @@ QVariant RawDatabase::extractData(sqlite3_stmt* stmt, int col)
} else {
const char* data = reinterpret_cast<const char*>(sqlite3_column_blob(stmt, col));
int len = sqlite3_column_bytes(stmt, col);
return QByteArray::fromRawData(data, len);
return QByteArray(data, len);
}
}

Loading…
Cancel
Save