CMapStringToOb Problem

Posted on 2000-01-19
Medium Priority
Last Modified: 2013-11-20
Guys I hope you can help me here.

I have a CMapStringToOb member within a parent class that refers to other instances of a particular class within the scope of the application.

Just before the application terminates, the parent class' destructor loops round the map and deletes the referred to instances of the particular class (they were new'd when they were created).

However, here lies the problem.  When deleting within the loop one class instance, I get this error message :

DAMAGE: after normal block (#2354) at 0x00D 46AEO.

I have checked and checked this class instance during the application scope and it doesn't seem to change in anyway.

Anyone know what the problem is.  I've really racked my brains over this one but can't come up with a solution.

Thanks in advance.
Question by:carlpaddick

Expert Comment

ID: 2368061
Can we see the code that allocates the objects and the code that deletes them?

Accepted Solution

GGRUNDY earned 150 total points
ID: 2369907
If I got a message like that I would assume that one of the objects that I was freeing had written inadventantly over the heap. e.g. maybe the class contains a char[10] member and I had copied too much data into it. If it was always block #2354 I would
use _CrtSetBreakAlloc to see exactly which object is being corrupted. I might also use _CrtCheckMemory to binary search though my code until I found to point at which the corruption is occuring. When the object is being freed the horse has already bolted.

Author Comment

ID: 2370249
Thanks Grundy.

I also have a class derived from the  class in question .  I inadvertantly added an extra member variable to this derived class, and in the application made a cast and assignment which increased the size of the class in question.  The parent class' destructor obviously threw a wobbler when it came to deleting something that was larger than it created orginally.

Thanks for your help.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question