g_spawn_async_with_pipes: the GUI freezes anyway



Hi,

I run the rar executable with the option a (add) on a very large archive with g_spawn_async_with_pipes but the GUI freezes until the
rar executable has finished its job. I'm wondering why ? These are
the parameters I use with g_spawn_async_with_pipes:

        GError *error = NULL;
        gchar **argv;
        int argcp;
        g_print ("Eseguo: %s\n",command);
        g_shell_parse_argv ( command , &argcp , &argv , NULL);
        if ( ! g_spawn_async_with_pipes (
                NULL,
                argv,
                NULL,
                G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
                NULL,
                NULL,
                &child_pid,
                NULL,
                &output_fd,
                &error_fd,
                &error) )
        {
response = ShowGtkMessageDialog (GTK_WINDOW (MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK, error->message);
                g_error_free (error);
                return FALSE;
        }
        g_strfreev ( argv );
//The following callback is needed for evaluating the exit status of the launched compressor
        g_child_watch_add  ( child_pid , (GChildWatchFunc) ExitStatus , NULL );
        return (gulong) child_pid;

May someone help please ?
--
Colossus

Cpsed, a Linux OpenGL 3D scene editor
http://cpsed.sourceforge.net/




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