• Martin's avatar
    Use convert_return_gchar_ptr_to_*() in a couple of ustring methods · 5d634e30
    Martin authored
    First attempt at fixing memory leak in make_valid() (see previous commit)
    used make_unique_ptr_gfree() directly because of looking at these methods.
    Better to use the helper function.
    
    This actually fixes undefined behavior for normalize() since
    g_utf8_normalize() is documented to return NULL if string is not a valid
    UTF-8 string. The constructor for std::string, which ustring uses for
    storage, that takes a pointer is documented to have undefined behavior if
    pointer is NULL. The utility function checks for NULL and uses the default
    constructor in that case. (Have not looked at implementation of Glib
    functions, and it may be that all std::string implementations Glibmm is
    used with handles this case, but good to avoid undefined behavior
    regardless, I think.)
    5d634e30
Name
Last commit
Last update
MSVC_NMake Loading commit data...
build Loading commit data...
docs Loading commit data...
examples Loading commit data...
gio Loading commit data...
glib Loading commit data...
tests Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
COPYING.tools Loading commit data...
ChangeLog Loading commit data...
ChangeLog.pre-2-36-2 Loading commit data...
HACKING Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
README.SUN Loading commit data...
README.win32 Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
glibmm.doap Loading commit data...