Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug memory leak in IMGUI Demo #10

Closed
ZahlGraf opened this issue Oct 20, 2015 · 2 comments
Closed

Debug memory leak in IMGUI Demo #10

ZahlGraf opened this issue Oct 20, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@ZahlGraf
Copy link
Owner

The IMGUI Demo example does not free up all memory allocated internally for IMGUI.
It is important to debug this and to find out, if this is an issue of IrrIMGUI or the Example program, or if this is an issue of IMGUI.

@ZahlGraf ZahlGraf added the bug label Oct 20, 2015
@ZahlGraf ZahlGraf self-assigned this Oct 20, 2015
@ZahlGraf ZahlGraf added this to the Version 0.4 milestone Oct 20, 2015
ZahlGraf pushed a commit that referenced this issue Oct 21, 2015
Switched off the IMGUI memory leak detection for Demo example (related to #10).
@ZahlGraf
Copy link
Owner Author

The memory leak in the Demo example is a false negative. It comes from static data inside the Demo-Window function from IMGUI. When the Demo-Window function uses these data the first time, it allocates dynamically memory from the heap.
However static variables are deleted during program exit, thus the memory is still allocated when IMGUI shutdowns and the memory consistency check is performed. So we get an error message for that, but it is not a real error.

There is no way to force the application to delete this static variable earlier, so the only possibility is here to disable the memory leak detection to not get false negative error reports.

@ZahlGraf
Copy link
Owner Author

The static memory is allocated at line 674 of file imgui_demo.cpp:

static ImVector<float> values; if (values.empty()) { values.resize(90); memset(values.Data, 0, values.Size*sizeof(float)); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant