This seems tricky:
v->param = ba.data();
QByteArray ba;
v->param = ba.data();
To copy to clipboard, switch view to plain text mode
From the error message you gave earlier it seems v->param is of type char*. If that is true, then
{
// ...
v->param = ba.data();
}
// v->param is a dangling pointer here
{
QByteArray ba;
// ...
v->param = ba.data();
}
// v->param is a dangling pointer here
To copy to clipboard, switch view to plain text mode
If v is only used in the same scope the byte array is used (the byte array exists as long as you use v) you should be ok though.
Bookmarks