[Dev-C++] memory allocation with STL list
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Pablo <pa...@ho...> - 2003-02-19 17:28:19
|
I have a problem with the list template from the STL, illustrated in the =
following simple code:
#include <iostream>
#include <stdlib.h>
#include <list>
using namespace std;
=20
void f()
{
list<double> l;
for (int i=3D0; i<1000000;i++) l.push_back(i);
}
=20
int main()
{
f();
system("PAUSE");
return 0;
}
The code compiles and runs ok with Dev C++, but the problem is that the =
memory used by the list remains allocated, even when the object is no =
longer accessible (at the "pause" prompt).=20
This does not happen with other STL templates (deque, vector,...) under =
Dev C++, neither with lists under Borland compilers.
Does anyone know how to address this?
Thanks in advance for your help.
|