|
From: Adrian F. <fe...@ma...> - 2000-06-29 15:33:04
|
Hi,
On Thu, 29 Jun 2000, Allin Cottrell wrote:
> I'm using memprof on my app, and I see that when I open and
> close a gtksheet there's a lot of memory leaked (all the cell
> allocations for instance). Can you tell me the right way to
> free a gtksheet? At present I have a sheet ("mysheet") wrapped
> in a toplevel window ("sheetwin"), and a close button that
> destroys the toplevel. I tried adding
>
> gtk_signal_connect (GTK_OBJECT(sheetwin), "destroy",
> GTK_SIGNAL_FUNC (destroy_sheet), NULL);
In first place, I think that you don't need to connect the destroy signal,
the sheet will be destroyed automaticaly with the window, and free the
memory.
>
> where
>
> static void destroy_sheet (void)
> {
> gtk_object_destroy(GTK_OBJECT(mysheet));
> }
I also have the impression that the proper way is using
gtk_object_unref(GTK_OBJECT(mysheet));
Apparently, this function calls both: gtk_object_destroy, and
gtk_object_finalize
Tell me if it works out.
Regards,
<ADRIAN>
BTW, if you want to be updated and have more feedback, you may want to
subscribe to the mailing list.
>
> but this didn't seem to make any difference. Any help would be
> much appreciated.
>
> --
> Allin Cottrell
> Department of Economics
> Wake Forest University, NC
>
>
|