D
DDD
I have a piece of codes
// a.dll
void getMyObject(vector<MyClass> &myObject)
{
MyClass a;
...
myObject.push_back(a);
...
MyClass b;
...
myObject.push_back(b);
...
}
void test()
{
....
vector<MyClass> myObject;
// call a function from a.dll
getMyObject(myObject);
// access the myObject
....
return;
}
After runtime come out test() function, there will be an error.
From callback heap view, I see the error comes from vector destruct
function.
Is it because myObject will reallocate object which allocate in a.dll?
// a.dll
void getMyObject(vector<MyClass> &myObject)
{
MyClass a;
...
myObject.push_back(a);
...
MyClass b;
...
myObject.push_back(b);
...
}
void test()
{
....
vector<MyClass> myObject;
// call a function from a.dll
getMyObject(myObject);
// access the myObject
....
return;
}
After runtime come out test() function, there will be an error.
From callback heap view, I see the error comes from vector destruct
function.
Is it because myObject will reallocate object which allocate in a.dll?