#include "pandaFramework.h"
#include "pandaSystem.h"
int main(int argc, char *argv[]) {
//open a new window framework
PandaFramework framework;
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title("My Panda3D Window");
//open the window
WindowFramework *window = framework.open_window();
//here is room for your own code
//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}
Leading to leakage of 0.004 kb 1 sec.
Compiler Options:
-------------- Build: Release in TestPanda3D (compiler: Microsoft Visual C++ 2010)---------------
cl.exe /nologo /O2 /EHsc /MD /DNDEBUG /IC:\Panda3D-1.9.2-x64\include /IC:\Panda3D-1.9.2-x64\python\include /I"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include" /I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" /c main.cpp /Foobj\Release\main.obj
main.cpp
link.exe /nologo /LIBPATH:C:\Panda3D-1.9.2-x64\lib /LIBPATH:C:\Panda3D-1.9.2-x64\python\libs /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib\amd64" /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64" /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib" /out:bin\Release\TestPanda3D.exe libp3framework.lib libpanda.lib libpandaexpress.lib libp3dtool.lib libp3dtoolconfig.lib libp3pystub.lib libp3direct.lib obj\Release\main.obj
Output file is bin\Release\TestPanda3D.exe with size 11.50 KB
Process terminated with status 0 (0 minute(s), 30 second(s))
0 error(s), 0 warning(s) (0 minute(s), 30 second(s))
As a heads up, Windows Task Manager is not always the best way to check for memory leaks (especially down to 0.004kb). Something like Valgrind’s memcheck tool or Visual Leak Detector are usually much more accurate (and can help pinpoint the leak). As such, I wouldn’t expect much effort from devs to go into investigating or developing a “fix” of some sort without more data.
You will not believe the code from the textbook has a memory leak.
#include "pandaFramework.h"
#include "pandaSystem.h"
int main(int argc, char *argv[]) {
//open a new window framework
PandaFramework framework;
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title("My Panda3D Window");
//open the window
WindowFramework *window = framework.open_window();
//here is room for your own code
//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}