Use an explicit constructor for TreeNode

List initialization ended using movable constructors which surprisingly caused data troubles in release mode, at least in VC2019 compiler. The tree being messed up caused crashes while SQL was generated.

I have no explanation for it.
This commit is contained in:
Luis Ángel San Martín
2021-01-14 08:49:48 +01:00
parent f09c5955d8
commit 260f538de3
2 changed files with 14 additions and 8 deletions

View File

@ -45,6 +45,11 @@ public:
std::string t;
std::vector<TreeNode> children;
explicit TreeNode(std::string t, std::vector<TreeNode> children)
: t(t), children(children)
{
}
int buildSqlString(std::string &sqlString, int bindPosition = 0) const;
int bindValues(QSqlQuery &selectQuery, int bindPosition = 0) const;
};