Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How Locate the error when meet the leak?

How Locate the error when meet the leak?

Scheduled Pinned Locked Moved C / C++ / MFC
performancehelpquestion
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    liuty2006
    wrote on last edited by
    #1

    How Locate the error when meet the leak as follow? ///////////////// Detected memory leaks! Dumping objects -> {46} client block at 0x009C2590, subtype 0, 100 bytes long. a CWnd object at $009C2590, 100 bytes long Object dump complete. The thread 0x244 has exited with code 0 (0x0). ////////////////////// thanks in advance!!

    I C M I 4 Replies Last reply
    0
    • L liuty2006

      How Locate the error when meet the leak as follow? ///////////////// Detected memory leaks! Dumping objects -> {46} client block at 0x009C2590, subtype 0, 100 bytes long. a CWnd object at $009C2590, 100 bytes long Object dump complete. The thread 0x244 has exited with code 0 (0x0). ////////////////////// thanks in advance!!

      I Offline
      I Offline
      includeh10
      wrote on last edited by
      #2

      how do u get those wonderful information? includeh10

      C I 2 Replies Last reply
      0
      • L liuty2006

        How Locate the error when meet the leak as follow? ///////////////// Detected memory leaks! Dumping objects -> {46} client block at 0x009C2590, subtype 0, 100 bytes long. a CWnd object at $009C2590, 100 bytes long Object dump complete. The thread 0x244 has exited with code 0 (0x0). ////////////////////// thanks in advance!!

        C Offline
        C Offline
        Chris Losinger
        wrote on last edited by
        #3

        1. find out where you allocated a CWnd. 2. determine where you can it. 3. delete it. -c


        A conclusion is simply the place where someone got tired of thinking.

        Smaller Animals Software

        L 1 Reply Last reply
        0
        • I includeh10

          how do u get those wonderful information? includeh10

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          it's in the VC debugger's output window


          A conclusion is simply the place where someone got tired of thinking.

          Smaller Animals Software

          1 Reply Last reply
          0
          • C Chris Losinger

            1. find out where you allocated a CWnd. 2. determine where you can it. 3. delete it. -c


            A conclusion is simply the place where someone got tired of thinking.

            Smaller Animals Software

            L Offline
            L Offline
            liuty2006
            wrote on last edited by
            #5

            If there is a method to tell which CWnd is not delete? thanks!

            1 Reply Last reply
            0
            • L liuty2006

              How Locate the error when meet the leak as follow? ///////////////// Detected memory leaks! Dumping objects -> {46} client block at 0x009C2590, subtype 0, 100 bytes long. a CWnd object at $009C2590, 100 bytes long Object dump complete. The thread 0x244 has exited with code 0 (0x0). ////////////////////// thanks in advance!!

              M Offline
              M Offline
              Maximilien
              wrote on last edited by
              #6

              Look at default c++ files generated by Visual C++, they usually/always have a few preprocessor lines at the beginning that enable additional debugging info, as well as leak information; if it's defined, the leak is identified, with the code line where the allocation was made. Max.

              1 Reply Last reply
              0
              • I includeh10

                how do u get those wonderful information? includeh10

                I Offline
                I Offline
                ian mariano
                wrote on last edited by
                #7

                Detecting and Isolating Memory Leaks Using Microsoft Visual C++[^]

                "The greatest danger to humanity is humanity without an open mind."
                  - Ian Mariano - http://www.ian-space.com/

                1 Reply Last reply
                0
                • L liuty2006

                  How Locate the error when meet the leak as follow? ///////////////// Detected memory leaks! Dumping objects -> {46} client block at 0x009C2590, subtype 0, 100 bytes long. a CWnd object at $009C2590, 100 bytes long Object dump complete. The thread 0x244 has exited with code 0 (0x0). ////////////////////// thanks in advance!!

                  I Offline
                  I Offline
                  ian mariano
                  wrote on last edited by
                  #8

                  Since you've already got that intel, I think you may have seen Detecting and Isolating Memory Leaks Using Microsoft Visual C++[^]. Further in that article, there's a section called Comparing Memory States. If you suspect code that's leaking, wrap it with a call to checkpoint the memory before, and after, then compare. The article gives an example.

                  "The greatest danger to humanity is humanity without an open mind."
                    - Ian Mariano - http://www.ian-space.com/

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups