On Sun, 11 Apr 2010 17:42:38 +0100 Chris Vine <[email protected]> wrote: > You should call _exit() (and incidentally NOT exit()) at the end of > the child process. (That is at the end of the if block representing > the child process.)
And incidentally if you do that, you will probably get away with omitting the call to Gtk::Main::quit(). I have been looking through some of my code to see why I do what I do and the principle reason why I fork() and then exec() from a thread is to call waitpid() in the parent thread in order to obtain an exit status, which that thread then sends on to the program main loop with an event object (which under the hood comprises an idle source callback). If you don't fork from a new thread, what you must avoid is the child process ever entering its copy of the main loop or in any other way attempting to invoke any X functions. In the example given to you if you call _exit() at the end of the relevant if block it won't do so, even without the call to Gtk::Main::quit(). Likewise, if all you were going to do is call exec() shortly after the fork() and are not interested in exit status. Chris _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
