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. Why CString is Not Relasing memory in Release mode

Why CString is Not Relasing memory in Release mode

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiographicsdebuggingperformance
4 Posts 4 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
    Ramasani
    wrote on last edited by
    #1

    Its very Urgent for me In my program CString is not Releasing the memory in Release mode in vc6.0 only it's working fine in debug mode and later versions of visual studio here i am sending a sample application can any one send replay its very urgent for me. #include "stdafx.h" #include "afx.h" #include "afxwin.h" #include <windows.h> #include "fixalloc.h" #pragma warning (disable:4786) #pragma warning (disable:4503) #include<list> #include<string> #include<vector> using namespace std; void test() { vector<CString> stldmlist; CString a; FILE *fp=fopen("E:\\log1.txt","r"); char str[1000]; while(!feof(fp)) { fscanf(fp,"%s\n",str); a=str; stldmlist.push_back(a); } fclose(fp); AfxMessageBox("Memory"); } UINT32 main(int argc, char* argv[]) { AfxMessageBox("Start "); test(); AfxMessageBox("End"); return 1; }

    Hi this Ravinder

    S CPalliniC R 3 Replies Last reply
    0
    • R Ramasani

      Its very Urgent for me In my program CString is not Releasing the memory in Release mode in vc6.0 only it's working fine in debug mode and later versions of visual studio here i am sending a sample application can any one send replay its very urgent for me. #include "stdafx.h" #include "afx.h" #include "afxwin.h" #include <windows.h> #include "fixalloc.h" #pragma warning (disable:4786) #pragma warning (disable:4503) #include<list> #include<string> #include<vector> using namespace std; void test() { vector<CString> stldmlist; CString a; FILE *fp=fopen("E:\\log1.txt","r"); char str[1000]; while(!feof(fp)) { fscanf(fp,"%s\n",str); a=str; stldmlist.push_back(a); } fclose(fp); AfxMessageBox("Memory"); } UINT32 main(int argc, char* argv[]) { AfxMessageBox("Start "); test(); AfxMessageBox("End"); return 1; }

      Hi this Ravinder

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      Same sample code, same question again - you're persistent, I'll give you that... However, again - no objective evidence confirming your hypothesis, same belief that it must be MFC that has the problem, not your code or understanding. Help us to help you - tell us in detail why you think MFC is wrong, with proper, reproducible evidence - then maybe someone can help!!!

      1 Reply Last reply
      0
      • R Ramasani

        Its very Urgent for me In my program CString is not Releasing the memory in Release mode in vc6.0 only it's working fine in debug mode and later versions of visual studio here i am sending a sample application can any one send replay its very urgent for me. #include "stdafx.h" #include "afx.h" #include "afxwin.h" #include <windows.h> #include "fixalloc.h" #pragma warning (disable:4786) #pragma warning (disable:4503) #include<list> #include<string> #include<vector> using namespace std; void test() { vector<CString> stldmlist; CString a; FILE *fp=fopen("E:\\log1.txt","r"); char str[1000]; while(!feof(fp)) { fscanf(fp,"%s\n",str); a=str; stldmlist.push_back(a); } fclose(fp); AfxMessageBox("Memory"); } UINT32 main(int argc, char* argv[]) { AfxMessageBox("Start "); test(); AfxMessageBox("End"); return 1; }

        Hi this Ravinder

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        What makes you conclude that it isn't releasing memory?

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        1 Reply Last reply
        0
        • R Ramasani

          Its very Urgent for me In my program CString is not Releasing the memory in Release mode in vc6.0 only it's working fine in debug mode and later versions of visual studio here i am sending a sample application can any one send replay its very urgent for me. #include "stdafx.h" #include "afx.h" #include "afxwin.h" #include <windows.h> #include "fixalloc.h" #pragma warning (disable:4786) #pragma warning (disable:4503) #include<list> #include<string> #include<vector> using namespace std; void test() { vector<CString> stldmlist; CString a; FILE *fp=fopen("E:\\log1.txt","r"); char str[1000]; while(!feof(fp)) { fscanf(fp,"%s\n",str); a=str; stldmlist.push_back(a); } fclose(fp); AfxMessageBox("Memory"); } UINT32 main(int argc, char* argv[]) { AfxMessageBox("Start "); test(); AfxMessageBox("End"); return 1; }

          Hi this Ravinder

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          How are you concluding that CString isn't releasing memory? Are you using some kind of a utility that is reporting it? If yes, then I think that your utility sucks and you should stop using it.

          It is a crappy thing, but it's life -^ Carlo Pallini

          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