Wait for our child to exit before quitting. The prevents us from pulling
Fri Mar 12 10:53:10 1999 Owen Taylor <otaylor@redhat.com> * capplets/theme-switcher/main.c (main): Wait for our child to exit before quitting. The prevents us from pulling the socket window out from under our child. * capplets/theme-switcher/demo.c (demo_main): Clean up some warnings about types in formats. * capplets/theme-switcher/demo.c (demo_main): Exit cleanly if read from parent fails - don't drop a core.
This commit is contained in:
parent
4d6e8150b5
commit
af81c4017f
8 changed files with 116 additions and 63 deletions
|
@ -8,12 +8,13 @@ int
|
|||
main(int argc, char **argv)
|
||||
{
|
||||
GtkWidget *w;
|
||||
gint child_pid;
|
||||
|
||||
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
set_tmp_rc();
|
||||
do_demo(argc, argv);
|
||||
child_pid = do_demo(argc, argv);
|
||||
switch (gnome_capplet_init ("theme-switcher-capplet",
|
||||
THEME_SWITCHER_VERSION, argc, argv, NULL, 0, NULL)) {
|
||||
case -1:
|
||||
|
@ -26,5 +27,11 @@ main(int argc, char **argv)
|
|||
send_socket();
|
||||
|
||||
gtk_main();
|
||||
/* Pause here until our child exits and the socket can be safely
|
||||
* destroyed
|
||||
*/
|
||||
if (child_pid > 0)
|
||||
waitpid(child_pid, NULL, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue