need help for memeory leak detection

  • 14 years ago
    Can anybody give me some idea about the following memory leak?
    I turned on memory leak detection in my VC++ MFC project.  The Data "SPPA", "ROPA", "MDIA", "md", "MFIA", etc. are stored in a struct:

    struct XMLMappingFields
    {
        CString strLogFlow;
        CString strLogMD;
        CString strLogMudWT;
        CString strLogROP;
        CString strLogSPP;
    };

    class CMyDoc : public CDocument
    {
    protected: // create from serialization only
        CMyDoc();
        DECLARE_DYNCREATE(CMyDoc)

    // Attributes
    public:
        BOOL m_bSkipDPa;

        long m_nJobID;
        CString m_strJobName;
    .....
        XMLMappingFields xmf;
     .....
    }

    However, when the program exit, in the VS debug window, it shows memory leak (See the end of my post for the output). Actually there is a memory leak in my program, but I cannot find it. I checked all new and delete pairs, I'm sure there is no missed delete. I used some COM object and MS XML toolkit objects in my application. the above XMLMappingFields struct is also used in the MS XML objects, is that the possible reason for the leak? Please give me some ideas! Thanks a lot!

    My Debug Window Output:
    ...............
    The thread 0x210 has exited with code 0 (0x0).
    Detected memory leaks!
    Dumping objects ->
    strcore.cpp(118) : {11517} normal block at 0x06B56B98, 17 bytes long.
     Data: <            SPPA> 01 00 00 00 04 00 00 00 04 00 00 00 53 50 50 41
    strcore.cpp(118) : {11516} normal block at 0x06B56B40, 17 bytes long.
     Data: <            ROPA> 01 00 00 00 04 00 00 00 04 00 00 00 52 4F 50 41
    strcore.cpp(118) : {11515} normal block at 0x06B56AE8, 17 bytes long.
     Data: <            MDIA> 01 00 00 00 04 00 00 00 04 00 00 00 4D 44 49 41
    strcore.cpp(118) : {11514} normal block at 0x06B56A90, 15 bytes long.
     Data: <            md > 01 00 00 00 02 00 00 00 02 00 00 00 6D 64 00
    strcore.cpp(118) : {11513} normal block at 0x06B56A38, 17 bytes long.
     Data: <            MFIA> 01 00 00 00 04 00 00 00 04 00 00 00 4D 46 49 41
    strcore.cpp(118) : {11184} normal block at 0x06B59AC0, 77 bytes long.
     Data: <    @   @   Smit> 01 00 00 00 40 00 00 00 40 00 00 00 53 6D 69 74
    strcore.cpp(118) : {10978} normal block at 0x06B59A68, 25 bytes long.
     Data: <            Smit> 02 00 00 00 0C 00 00 00 0C 00 00 00 53 6D 69 74
    strcore.cpp(118) : {10971} normal block at 0x06B59C88, 34 bytes long.
     Data: <            Smit> 01 00 00 00 15 00 00 00 15 00 00 00 53 6D 69 74
    strcore.cpp(118) : {10891} normal block at 0x06B59950, 23 bytes long.
     Data: <            w6_w> 02 00 00 00 0A 00 00 00 0A 00 00 00 77 36 5F 77
    strcore.cpp(118) : {10782} normal block at 0x06B58B50, 19 bytes long.
     Data: <            w6_s> 02 00 00 00 06 00 00 00 06 00 00 00 77 36 5F 73
    strcore.cpp(118) : {8582} normal block at 0x06B52390, 27 bytes long.
     Data: <            1.2.> 01 00 00 00 07 00 00 00 0E 00 00 00 31 2E 32 2E
    strcore.cpp(118) : {8575} normal block at 0x06B52510, 75 bytes long.
     Data: <        >   Func> 01 00 00 00 1F 00 00 00 3E 00 00 00 46 75 6E 63
    strcore.cpp(118) : {8553} normal block at 0x06B64EE0, 80 bytes long.
     Data: <    C   C   http> 04 00 00 00 43 00 00 00 43 00 00 00 68 74 74 70
    strcore.cpp(118) : {8452} normal block at 0x06B52838, 23 bytes long.
     Data: <            Smit> 02 00 00 00 0A 00 00 00 0A 00 00 00 53 6D 69 74
    strcore.cpp(118) : {8440} normal block at 0x06B457D8, 23 bytes long.
     Data: <            yiel> 02 00 00 00 0A 00 00 00 0A 00 00 00 79 69 65 6C
    strcore.cpp(118) : {8427} normal block at 0x06B45780, 19 bytes long.
     Data: <            yp10> 01 00 00 00 06 00 00 00 06 00 00 00 79 70 31 30
    .......................



































































Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Never trust a programmer in a suit.” - Anonymous