dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.48k stars 112 forks source link

ncpp::Progbar breaks Plane it takes ownership of #2660

Open bzeller opened 2 years ago

bzeller commented 2 years ago

Maybe I'm missing something but:

In the cpp Progbar implementation: https://github.com/dankamongmen/notcurses/blob/2316c7e646dfd8c6fc7af8cd25b96ab6bda15e8b/include/ncpp/Progbar.hh#L22

progbar takes ownership of the ncpp::Plane 's C pointer but does not reset it inside the ncpp::Plane instance that is passed to Progbar. This always results in either a double free when the cpp Plane instance is released or a memory leak if the cpp Plane is never released to work around the double free issue.