Error when "delete[] m_pHashTable" in CMap 
Author Message
 Error when "delete[] m_pHashTable" in CMap

Hi,
  I run my program which use the MFC CMap, it run smoothly, but when I
turn in to run debug mode, error occur when I call "RemoveAll()"
method, and it stop at the line "delete[] m_pHashTable;".
  I have checked the program have allocated to m_pHashTable, while
error still occur, does any know what's the problem??

  Thanks..

Regards,
Thomas



Thu, 12 Feb 2004 18:25:33 GMT  
 Error when "delete[] m_pHashTable" in CMap
Any suggestion or solution is appreciated!!
Thanks...


Sat, 21 Feb 2004 16:07:50 GMT  
 Error when "delete[] m_pHashTable" in CMap

Quote:

> Hi,
>   I run my program which use the MFC CMap, it run smoothly, but when I
> turn in to run debug mode, error occur when I call "RemoveAll()"
> method, and it stop at the line "delete[] m_pHashTable;".
>   I have checked the program have allocated to m_pHashTable, while
> error still occur, does any know what's the problem??

>   Thanks..

> Regards,
> Thomas

Some additional information, that I new the CMap with template
<unsigned short, unsigned short, RtpPacket*, RtpPacket*>, i.e declared
as
CMap<unsigned short, unsigned short, RtpPacket*, RtpPacket*>* map =
new CMap<unsigned short, unsigned short, RtpPacket*, RtpPacket*>();
and add with
map->SetAt(shortKey, packet); // where packet is a RtpPacket pointer.
Is there any problem with my declaration??


Sat, 21 Feb 2004 16:16:17 GMT  
 Error when "delete[] m_pHashTable" in CMap
Hi Thomas,

Is it possible for you to send me the sample project? That would be most
helpful in pinpointing the problem and solution. Please just give me a
simple project to demonstrate the problem. Or else I will spend more time
on understanding the project instead of the problem. Please also write a
"readme.txt" for the sample code to tell me how to reproduce your problem
step by step and help me to understand your project.

Thanks,

Jacob Yang



Fri, 05 Mar 2004 15:33:03 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error "free"-ing "malloc"-ed memory

2. Why can only undo "Delete"?

3. Delete "/" from char pointer

4. Deleting with "fwrite()"

5. ODBC, VFP and "real" deletes

6. how to use "delete"?

7. "delete []" in MSDN

8. Question about the operator "delete"

9. "scalar deleting destructor"

10. C++ question with "delete"

11. SUMMARY: "Deleting every other byte"

12. Can't "delete []"

 

 
Powered by phpBB® Forum Software