Fw: How to deallocate memory?
- From: "Jean-Christophe Berthon" <jean-christophe berthon cgey com>
- To: "Gtk List" <gtk-list gnome org>
- Subject: Fw: How to deallocate memory?
- Date: Tue, 24 Jul 2001 16:37:48 +0200
Oespie, I've made a mistake in the email address while replying to this
post, sorry for the inconvenience. Below is the email I've sent, if somebody
can help me...
Thanks a lot :-)
Jean-Christophe
----- Original Message -----
From: "Jean-Christophe Berthon" <jberthon capgemini fr>
To: "Havoc Pennington" <hp redhat com>
Sent: Tuesday, July 24, 2001 10:41 AM
Subject: Re: How to deallocate memory?
> Hy everyone,
>
> Sorry to only reply now to this "old" post, but I have a question
regarding
> the gtk_widget_destroy feature.
>
>
> For each windows, I'm puting code on the "delete" event to check if the
data
> of the window have been modify and in this case displaying a dialog box
> asking the user for saving. If he push cancel, then I return TRUE and the
> widget is not destroy.
>
> This is working perfectly when the user click on the cross button (to
close
> the window).
>
>
> But I put a "close" feature in a menu, and I was trying to use the
> gtk_widget_destroy function. The problem is that in this case the only
event
> fired is the "unrealize" one. Which cannot stop the process of destroying
> the widget...
>
> Is that something "normal" (or "standard") or is it a "bug"?
> I mean (thinking logical) if I destroy a widget I would expect the
"destroy"
> event to be fired!
>
>
> PS: Anyway I found a workaround, on the "close" menu callback, I'm
checking
> if the data is modifyed prior to call gtk_widget_destroy. But I don't find
> it a good solution as I have code duplicated now which is not a smart
thing
> to do... And so I would prefer to find out why the behaviour of the
> gtk_widget_destroy is like that.
>
>
> Best regards,
> ---
> Jean-Christophe Berthon
>
> Cap Gemini -- Ernst & Young
> Toulouse FR
> Skill Aerospace -- Image Quality
>
>
> ----- Original Message -----
> From: "Havoc Pennington" <hp redhat com>
> To: "Esteban Quijano Vincenzi" <Esteban Quijano artinsoft com>
> Cc: <gtk-list gnome org>
> Sent: Friday, July 13, 2001 7:44 PM
> Subject: Re: How to deallocate memory?
>
>
> >
> > Esteban Quijano Vincenzi <Esteban Quijano artinsoft com> writes:
> > > Is it possible to free the memory allocated for a widget using
> > > gtk_widget_destroy().
> > > However, when I try to free a window or a button with
> > > gtk_widget_destroy(GTK_WIDGET(widget))
> > > I have a run-time error saying that it is not a widget.
> >
> > A bug in your program. Maybe you are freeing things twice and the
> > second time you have junk memory instead of a widget.
> >
> > Havoc
> >
> > _______________________________________________
> > gtk-list mailing list
> > gtk-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtk-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]