I am working on a ApxTrace class written by an ex-colleague
External class will call copyTrace()
public member function to duplicate a ApxTrace class.
ApxTrace class contains QVector
data member
Here is the code:
void ApxTrace::copyTrace(ApxTrace& trace)
{
*this = trace;
}
However it gave unhandled exception (QTCored4.dll): Access violation writing location 0xfeeeefeee in the debug version of the software. Interestingly to note is that code is working well and properly in the release version of the software.
The callStack shows that ApxTrace::operator=(const APxTrace &_that)
is called, however, the ApxTrace class does not support assignment operator.
Please advice:
- Why the assignment operator is called in this case ?
- Comment on the
CopyTrace()
above ? I understand self assignment is not handled here. - Why it is working well in the release version of the software?