Hi,[color=blue]
>[/color]
I'm having a debug assertion error within the file dbgdel.cpp with the
expression:
_BLOCK_TYPE_IS_ VALID(pHead->nBlockUse)
I traced the origin of the error and it happened as I tried to delete a
polymorphic class as follows:
class __declspec(dlle xport) A {
public:
char* name;
A( ) { }
virtual ~A( ) { delete name; }
}
class B {
public:
B( ) { }
virtual ~B( ) { }
}
class C: public A, public B {
public:
C( ) { name = "I am C"; }
~C( ) { }
}
int main() {
B* obj = new C;
delete B;
}
This is done in VC 7.1. Can anyone help me solve my problem?
>[/color]
I'm having a debug assertion error within the file dbgdel.cpp with the
expression:
_BLOCK_TYPE_IS_ VALID(pHead->nBlockUse)
I traced the origin of the error and it happened as I tried to delete a
polymorphic class as follows:
class __declspec(dlle xport) A {
public:
char* name;
A( ) { }
virtual ~A( ) { delete name; }
}
class B {
public:
B( ) { }
virtual ~B( ) { }
}
class C: public A, public B {
public:
C( ) { name = "I am C"; }
~C( ) { }
}
int main() {
B* obj = new C;
delete B;
}
This is done in VC 7.1. Can anyone help me solve my problem?
Comment