Re: ustring memory leak



On Thu, 1 Apr 2010 13:41:53 +0200
Fabian Jacquet <fabian jacquet gmail com> wrote:
> If I replace Glib::ustring by std::string, I don't have the memory
> leak.

Even if you include the call to Glib::thread_init() when you only use
std::string?

If so it must be related to a call to g_utf8_collate(): the constructor
Glib::ustring taking a string literal just calls the constructor of
std::string, so that can't be it, but the comparison operator calls
Glib::ustring::compare(), which calls g_utf8_collate().

There are two possibilities: either g_utf8_collate() is causing glib
memory slices to reserve memory (in which case it isn't really a leak),
or it is connected with locale handling in g_utf8_collate() when
interfacing with windows.

You report elsewhere that the problem disappears if you use
Glib::Thread.  That is even more inexplicable, except that I suppose it
shows it might be connected with memory slices (glib might be reusing
in the utf8 function memory left over from starting the thread).

Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]