-
Notifications
You must be signed in to change notification settings - Fork 8
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
Possible memory leak when creating a region #8
Comments
I'm working on this... (see osch@0d58a59). Perhaps there are some more dark corners around here... |
I was thinking... how about adding an internal kind of userdata that just does That would be a more local code change, I think. If you want, I can try working on this. |
This would generally be a useful tool, perhaps there are more places where this can be useful.
One could additional free the memory manually, so it would only be freed in the the garbage collector in error case. However I would also modify the current code as I suggested because I think there is more wrong here than the possible leak. E.g I would not iterate over all key values but only over the integer keys, see my code example. |
I thought again over this: we could avoid additional memory overhead by creating a userdata with a |
I just noticed a possible memory leak:
oocairo/obj_region.c
Lines 40 to 50 in 2aba6f9
The
calloc
result is leaked if an error happens (either vialuaL_error
or vialua_next
doing a longjmp).The text was updated successfully, but these errors were encountered: