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. General Programming
  3. C / C++ / MFC
  4. Memory Allocations/Deallocations problems

Memory Allocations/Deallocations problems

Scheduled Pinned Locked Moved C / C++ / MFC
c++ai-codingdebuggingperformancequestion
2 Posts 2 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.
  • R Offline
    R Offline
    rpadrela
    wrote on last edited by
    #1

    I'm using a library in my MFC application and i'm having some memory problems with allocations and deallocations, some memory allocations/deallocations causes a crash but only if it is not running on debug-mode. In debug-mode the application runs perfectly. Here's my lib configurations: engine.lib ( Non-MFC Code ): . Configuration Properties: ----. General: ------. Configuration Type: Static Library ( .lib ) ------. Use of MFC: Use Standard Windows Libraries ----. C++: ------. Code Generation: ---------. Runtime Library: Multi-Threaded Debug ( /MTd ) editor ( MFC Code ): . Configuration Properties: ----. General: ------. Configuration Type: Application ( .exe ) ------. Use of MFC: Use MFC in a Static Library ----. C++: ------. Code Generation: ---------. Runtime Library: Multi-Threaded Debug ( /MTd ) ------. Precompiled Header: ---------. Create/Use Precompiled Header: Automatically Generate( /YX ) ----. Linker: ------. Command Line: /NODEFAULTLIB:LIBCD.LIB Noticed anything wrong ? Any tip ? Thanks

    A 1 Reply Last reply
    0
    • R rpadrela

      I'm using a library in my MFC application and i'm having some memory problems with allocations and deallocations, some memory allocations/deallocations causes a crash but only if it is not running on debug-mode. In debug-mode the application runs perfectly. Here's my lib configurations: engine.lib ( Non-MFC Code ): . Configuration Properties: ----. General: ------. Configuration Type: Static Library ( .lib ) ------. Use of MFC: Use Standard Windows Libraries ----. C++: ------. Code Generation: ---------. Runtime Library: Multi-Threaded Debug ( /MTd ) editor ( MFC Code ): . Configuration Properties: ----. General: ------. Configuration Type: Application ( .exe ) ------. Use of MFC: Use MFC in a Static Library ----. C++: ------. Code Generation: ---------. Runtime Library: Multi-Threaded Debug ( /MTd ) ------. Precompiled Header: ---------. Create/Use Precompiled Header: Automatically Generate( /YX ) ----. Linker: ------. Command Line: /NODEFAULTLIB:LIBCD.LIB Noticed anything wrong ? Any tip ? Thanks

      A Offline
      A Offline
      Anthony_Yio
      wrote on last edited by
      #2

      It is nothing to do with your configuration. It very likely cause by your code. The reason it won't crash in debug mode is that your linker allocates more storage space for each memory blocks in your program for debug purposes. So, even if your program leaks, the extra space storage save you from crash. This is not going to happen when you are in release mode as when your linker allocate exact storage space for your program. Sonork 100.41263:Anthony_Yio

      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