PDA

View Full Version : smart_ptr deallocation



Unregistered
November 8, 2004, 16:36:34
This code leads to a "debug assertion failed" violation

Grabber::tVidNrmListPtr pVidNrmList =
grabber->getAvailableVideoNorms();

pVidNrmList = NULL;

When it gets to the line of code in the ~refcount_ptr destructor that it does

delete get()

, this violation message comes up:

Debug Assertion Failed!
Program: ...
File: dbgdel.cpp
Line: 52

Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

HELP!
Thanks,
Chris (crs8@lehigh.edu)

Stefan Geissler
November 9, 2004, 13:49:16
Hello,

This error occurs if:
- a debug version uses the release DLLs of the class library
- the application is not compile Multithreaded Debug DLL

Please check your compiler and linker settings.