diff options
Diffstat (limited to 'src/util.vala')
-rw-r--r-- | src/util.vala | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/util.vala b/src/util.vala index 8587d30..48df49b 100644 --- a/src/util.vala +++ b/src/util.vala @@ -462,32 +462,9 @@ namespace Boxes { } public async void exec (string[] argv, Cancellable? cancellable) throws GLib.Error { - SourceFunc continuation = exec.callback; - GLib.Error error = null; - var context = MainContext.get_thread_default (); - - g_io_scheduler_push_job ((job) => { - try { - exec_sync (argv); - } catch (GLib.Error err) { - error = err; - } - - var source = new IdleSource (); - source.set_callback (() => { - continuation (); - - return false; - }); - source.attach (context); - - return false; + yield run_in_thread (() => { + exec_sync (argv); }); - - yield; - - if (error != null) - throw error; } public void exec_sync (string[] argv) throws GLib.Error { |