I am a beginner with visual C++ and am have a really bad problem with a memory leak. Our app has a dialog with a loop in it that checks a device and reads in a text file. I suspect that the variable which is having the text file inputted into it is accruing the data with every cycle. Looking at the performance tab in task manager, total memory use increase by 500k on every loop. I want the loop to dump all its variables at the end of each cycle and start over, particulary "mb".
#include "FPMemBase.h"
CFPMemBase mb;
mb.LoadFromFile("c:\\file\\default.ndb"
; //lines from
//cpp
// CFPMemBase window //lines from
//FPMemBase.h
class CFPMemBase : public CWnd
{
// Construction
public:
CFPMemBase();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFPMemBase)
//}}AFX_VIRTUAL
// Implementation
public:
// Removes all from the database
HRESULT RemoveAll();
// Makes a copy of database file into the memory
HRESULT LoadFromFile(CHAR * FileName);
virtual ~CFPMemBase();
I tried using RemoveAll() against mb, and it was undeclared.
Is there possibly any function I could call that would just purge all virtual memory or a list of specified variables?
Any help would be greatly appreciated.
#include "FPMemBase.h"
CFPMemBase mb;
mb.LoadFromFile("c:\\file\\default.ndb"
//cpp
// CFPMemBase window //lines from
//FPMemBase.h
class CFPMemBase : public CWnd
{
// Construction
public:
CFPMemBase();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFPMemBase)
//}}AFX_VIRTUAL
// Implementation
public:
// Removes all from the database
HRESULT RemoveAll();
// Makes a copy of database file into the memory
HRESULT LoadFromFile(CHAR * FileName);
virtual ~CFPMemBase();
I tried using RemoveAll() against mb, and it was undeclared.
Is there possibly any function I could call that would just purge all virtual memory or a list of specified variables?
Any help would be greatly appreciated.