capy-ui / capy

💻Build one codebase and get native UI on Windows, Linux and Web
https://capy-ui.org
Mozilla Public License 2.0
1.6k stars 60 forks source link

c_api: fix memory leak #62

Closed thechampagne closed 11 months ago

trnxdev commented 11 months ago

from what I see this can be errdefer allocator.destroy(button);, but it's just me

thechampagne commented 11 months ago

from what I see this can be errdefer allocator.destroy(button);, but it's just me

It will not work because errdefer works only if the function returns an error.

trnxdev commented 11 months ago

It will not work because errdefer works only if the function returns an error.

Oh, right, sorry