[gtkada] Finalization do not seem to occure when closing app

Jeffrey Carter jrcarter at acm.org
Wed May 9 02:37:12 CEST 2001


Preben Randhol wrote:
> 
> When I close my GtkAda app with Gtk.Main.Gtk_Exit (0); I don't see the
> messages that are supposed to be printed to stdout when Finalization
> is called on a variable I have. This worked before I merged the GUI
> and the back-end code. Also if my app exits due to an exception, then
> I get the Finalization info.
> 
> Is there something I must do to ensure that finalization gets called ?

You need to call Gtk.Main.Main_Quit instead of Gtk_Exit. Gtk_Exit exits
your program immediately, bypassing the call to the runtime to perform
finalization. Main_Quit exits the Gtk main loop, allowing the program to
terminate normally.

-- 
Jeff Carter
"We call your door-opening request a silly thing."
Monty Python & the Holy Grail




More information about the gtkada mailing list