Re: [gtk-list] Re: how can I trust glib when it has so manymemleaks?



Lars Hallberg wrote:
> 
> On Thu, Mar 18, 1999 at 12:02:39PM +0000, Ionutz Borcoman wrote:
> > If my objects are static, they are destroyed when the main is finished.
> > The report of g_mem_profile will have no relevance in that case.
> 
> If You have static objekt using memory alocated thru glib You can't
> free all glib memory from main anyway. That may cose referenses
> to freed memory, multiple relesing. Most likly ends with an
> segfault.... This problem in being *shure* nothing hapens later
> might be another reson for glib not freeing its memory automatic.

> Controlling constuction order of static objects is hard (often
> linkorder dependent and stuff) but You could try calling g_mem_profile
> from some static dymmy objekts destructor. I have to admit not
> knowing if atexit is useful (is it run after static objekt
> destruktion?)
> 
> PS I do asume abowe that Your problem is to get a g_mem_profile
> call after all the static objects destruction. Corect me if
> I'm asuming wrong DS

I think I made a typo here: I meant to say automatic objects. Like:

int main()
{
	MyClass x;
}

Please excuse me for the confusion.

Ionutz



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