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

try to fix memory leak in QuadCommand #18992

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from

Conversation

summerinsects
Copy link
Contributor

#18140

I'm not sure whether it will break compatibility

@minggo
Copy link
Contributor

minggo commented Apr 10, 2019

why it has memory leak?

@summerinsects
Copy link
Contributor Author

For static GLushort* QuadCommand::__indices, which was newed in method QuadCommand::reIndex, nowhere deleted it

@minggo
Copy link
Contributor

minggo commented Apr 10, 2019

When resizing index, old indices are pushed into _ownedIndices, which is freed in destructor.

@summerinsects
Copy link
Contributor Author

but the the last time allocation was not freed.
I debug it on vs with crt library functions _CrtDumpMemoryLeaks and _CrtSetBreakAlloc, and it breaks here

@minggo
Copy link
Contributor

minggo commented Apr 10, 2019

We uses it as a cache, don't freed the last one or we will malloc/free memories all the time. vs debugger doesn't treat global memory well.

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

Successfully merging this pull request may close these issues.

None yet

2 participants