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
  1. Home
  2. C / C++ / MFC
  3. Memory leak?

Memory leak?

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 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.
  • K Offline
    K Offline
    Kevnar
    wrote on last edited by
    #1

    I'm having a very bizarre problem with a Visual C++ program I'm working on. The program seems to crash with an access violation when one of 3 certain string variables are accessed. I know it's 3 because for some reason switching the order of the variable declaration seems to switch the crash to one of the other 2 variables. I have no idea why this is happening or what do do about it. It just started all of the sudden in a part of the code I hadn't even changed. It only happens in Debug mode, only on my machine, and only with this project(I've never seen this before in any other project). I've since upgraded my RAM by 128MBs and reinstalled Visual C++ 6. This didn't fix the problem. Has anyone else ever encountered this before? How did you fix it?:confused: Why not throw away a dime, I throw away ten pennies all the time...

    G T 2 Replies Last reply
    0
    • K Kevnar

      I'm having a very bizarre problem with a Visual C++ program I'm working on. The program seems to crash with an access violation when one of 3 certain string variables are accessed. I know it's 3 because for some reason switching the order of the variable declaration seems to switch the crash to one of the other 2 variables. I have no idea why this is happening or what do do about it. It just started all of the sudden in a part of the code I hadn't even changed. It only happens in Debug mode, only on my machine, and only with this project(I've never seen this before in any other project). I've since upgraded my RAM by 128MBs and reinstalled Visual C++ 6. This didn't fix the problem. Has anyone else ever encountered this before? How did you fix it?:confused: Why not throw away a dime, I throw away ten pennies all the time...

      G Offline
      G Offline
      Ghazi H Wadi
      wrote on last edited by
      #2

      Hi Kevin, The program seems to crash with an access violation when one of 3 certain string variables are accessed. I know it's 3 because for some reason switching the order of the variable declaration seems to switch the crash to one of the other 2 variables How about posting some code. It is Illogical to define an inventor by his invention

      1 Reply Last reply
      0
      • K Kevnar

        I'm having a very bizarre problem with a Visual C++ program I'm working on. The program seems to crash with an access violation when one of 3 certain string variables are accessed. I know it's 3 because for some reason switching the order of the variable declaration seems to switch the crash to one of the other 2 variables. I have no idea why this is happening or what do do about it. It just started all of the sudden in a part of the code I hadn't even changed. It only happens in Debug mode, only on my machine, and only with this project(I've never seen this before in any other project). I've since upgraded my RAM by 128MBs and reinstalled Visual C++ 6. This didn't fix the problem. Has anyone else ever encountered this before? How did you fix it?:confused: Why not throw away a dime, I throw away ten pennies all the time...

        T Offline
        T Offline
        Tim Smith
        wrote on last edited by
        #3

        That just screams stack corruption. Are all your stack arrays large enough? Are you passing in a variable by pointer when it shouldn't be (type checking usually catches this unless you have to cast to (void **) with such things as QueryInterface. Tim Smith Descartes Systems Sciences, Inc.

        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