Closed lbaudoin closed 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.
This should be fixed by [a271b67]https://github.com/ipomoena/dasher/commit/a271b6753a9ab154d68ce96f1a16dd932bfd2a22)
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.