RE: Destroying a window



Title: RE: Destroying a window

I only create GtkWidget objects. I don't make g_malloc.



-----Message d'origine-----
De : mrl netbank com br [mailto:mrl netbank com br]
Envoye : mardi 12 mars 2002 17:06
A : zze-coframi balr001
Cc : Mailing list GTK+ (E-mail)
Objet : Re: Destroying a window


On Tue, Mar 12, 2002 at 11:40:46AM +0100, zze-coframi balr001 wrote:
> Hello,
>
> I've got an application where I create two windows. When I destroy one, the
> memory that is used by this window is not freed although calling
> gtk_widget_destroy fot that window. I see the memory I used looking at
> "top".
>
> Can anyone tell me why the memory used by my second window is not freed when
> I call gtk_widget_destroy for that window ??
>
> thanks a lot
>
> (I am using GTK.1.3.13.)
>
> Isabelle
>
---end quoted text---

Since gtk is based on glib, it calls g_malloc() instead malloc() directly.
When you alloc with g_malloc(), you have to free with g_free()..
So, why use these functions?
Becose the memory allocated is cached, and when you call g_malloc() again it dosn't make the system loose time again allocing your page..

Hope I helped.. :)

[]'s
--
Marcelo R Leitner <mrl netbank com br>
ICQ #: 29966851



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