![]() |
|
#1
|
|||
|
|||
CArray destruction problemI am facing a problem with a CArray. I have a class member of type CArray<MyType, MyType&> m_MyArray;
When the object is destroyed, of course the destructor of CArray<MyType, MyType&> is called. Here is the destructor: Help with Code Tags C++ Syntax (Toggle Plain Text) CPP / C++ / C Code:
The debugger shows my m_pData to be 0X00000005. As we can see from the code above, delete[] is called on this pointer because it is not NULL. The delete[] calls delete, which calls _free_dbg(), which calls CheckBytes(), where the pointer is passed already as 0X00000000 (bad ptr). On attempt to dereference this pointer ( if (*pb++ != bCheck)), a crash happens. Can somebody help me solve this problem, please? Thanks. Last edited by LuciWiz : 15-Sep-2009 at 07:36.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Apache Web Server newbie problem | niss3 | Apache Web Server Forum | 1 | 13-Apr-2009 19:38 |
| Torrents Download Problem | chandeep | Computer Software Forum - Linux | 7 | 09-Oct-2006 23:37 |
| Runtime Problem involving "printf" in C Program | supamakia | C Programming Language | 2 | 09-Oct-2005 11:09 |
| a significant problem after installing Xp | mohammad | Computer Software Forum - Windows | 10 | 09-Aug-2005 08:03 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The