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