Re: Exit from a window but the process still alive.



On Tue, Sep 21, 2004 at 03:50:31PM +0200, Bruno G. San Alejo wrote:

   Thanks, I connected the signal, but digging up at how an Gtk_Object 
gets destroyed I came accross the "finalize" method. It says that it's 
the last method invoked when destroying an object and it's only called 
when it's reference count is zero. I think that's the problem cause I'm 
setting the Gtk_window pointer to NULL and freeing it,

Ugh? You should never call free() or g_free() on object
pointers. Just dereference objects with g_object_unref(),
and for widgets normally don't even do that, but destroy
them with gtk_widget_destroy().

and when tracing 
the program it just doesn't get to that part (probably due to the 
optimization stuff). But I think that the problem is tha the pointer to 
the window never gets freed really. Also, there are severeal pointers to 
different window componets laying around and I'm not freeing those 
either because they have been made by Glade. I think the problem is that 
I should be doing some cleaning up at the destroy signal handler, as you 
said, but I don't know what clean up I must do or how.

This sounds complicated and quite different from the trivial
code you posted before.

I don't know what the Glade code does, however if the window
is closed its "destroy" method should be called, and if you
call gtk_main_quit() in its handler the program should
return from gtk_main(), and thus exit.  If your code is too
conceptually different from Gtk+ "Hello Wordl" or what you
posted, post something more accurate.

Yeti


--
Do not use tab characters. Their effect is not predictable.



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