I made a test with the simplest "hello.cxx", modified it as below...
// hello.cxx (example1)
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/run.h>
using namespace fltk;
int main(int argc, char **argv) {
int i = 0;
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
Window *window = new Window(300, 180);
//window->begin();
//Widget *box = new Widget(20, 40, 260, 100, "Hello, World!");
//box->box(UP_BOX);
//box->labelfont(HELVETICA_BOLD_ITALIC);
//box->labelsize(36);
//box->labeltype(SHADOW_LABEL);
//window->end();
//window->show(argc, argv);
//i = run();
window->destroy();
delete window;
return i;
}
Visual C++ reported many memory leaks in output window.
I also did the same test with "hello.cxx" in fltk1, just added "delete window;"
after "run()", no memery leak reported.
Why?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk