Re: Debug Assertion Failed _BLOCK_TYPE_IS_VALID(pHead->nBlockUse
- From: "Tom Widmer [VC++ MVP]" <tom_usenet@xxxxxxxxxxx>
- Date: Tue, 11 Apr 2006 10:13:50 +0100
Hi Chris, I inserted the _ASSERTE(_CrtCheckMemory()) in several places and debug step through them and nothing crashed. Does that mean I don't have a heap memory problem? The crash is not actually occuring at the vector.push_back(newUserData). I coded a copy constructor and a operator= overload for my class but it still crashing with "An unhandled win32 exception occurred in mmc.exe" which then only gives me the assembly code.
I'm calling the using: vector.push_back(*newUserData);
That is creating a problem becuase newUserData is a pointer to my class that's created using new. I add the * to it to de-reference it but the vector class indicates all my data member of that object can not be evaluated in the debugging mode. Anyway to work around this? Thank you.
Remember to delete the entries though, or you could use:
vector<shared_ptr<CUserContextData> > userDataObjects;
which will mean that the objects are auto-deleted.
- Prev by Date: Re: Passing a structure vs passing a pointer?
- Next by Date: Re: reference type
- Previous by thread: Re: Debug Assertion Failed _BLOCK_TYPE_IS_VALID(pHead->nBlockUse
- Next by thread: Re: Debug Assertion Failed _BLOCK_TYPE_IS_VALID(pHead->nBlockUse