dasher-project / dasher

Dasher
http://www.inference.phy.cam.ac.uk/dasher/
GNU General Public License v2.0
159 stars 45 forks source link

The Linux version leaks memory. #45

Closed lbaudoin closed 9 years ago

lbaudoin commented 9 years ago

In several places the Gtk2/... code returns char* or const char* without specifying if the memory should be released and often without releasing it even though it should. Example: 'dasher_editor_get_context' returns the value from gtk_text_buffer_get_text, then in CDasherControl::GetContext the value is converted to a std::string but never freed with g_free.

It would probably be easier to change the return values to be std::string so the caller doesn't have to read the documentation for proper handling.

ipomoena commented 9 years ago

+1 to changing it to std::string There are other places where memory leaks, but these are for infrequent actions, so I am ignoring them for now.

lbaudoin commented 9 years ago

This should be fixed by [a271b67]https://github.com/ipomoena/dasher/commit/a271b6753a9ab154d68ce96f1a16dd932bfd2a22)