Hi,
I'm using VC++ 6.0 (SP 5) and noticed this behavior:
Basically it comes down to this example:
// Class with virtual destructor
class CMyClass
{
public:
CMyClass() {}
virtual ~CMyClass(){}
};
int main(int argc, char* argv[])
{
int iSize = 0; // Normally comes from some function where 0 is possible
CMyClass *poMyArray = new CMyClass [iSize];
for (int i=0; i<iSize; i++)
{
// Do some calculation...
}
delete [] poMyArray;
// --> Unhandled exception in prog.exe: 0xC0000005: Access Violation
return 0;
}
If I make the destructor non-virtual everyhing is fine.
I've looked at some previous posts around this issue and some suggested it
to be a compiler bug.
If this was a compiler bug, has this been resolved in SP6 or
is this a good reason to upgrade to Visual Studio.NET ?
Best regards,
Colin B.