mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-31 06:13:29 +02:00
GWin32AppInfo: Check for task cancellation
We cannot cancel a spawn operation, but sometimes we have to spawn the target application mutiple times (e.g. in case the target app only supports one URI in its command-line, but we were given multiple URI's), in that case continuously check the cancellation status before attempting any spawn operation
This commit is contained in:
@@ -5110,6 +5110,9 @@ g_win32_app_info_launch_internal (GWin32AppInfo *info,
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
if (from_task && g_task_return_error_if_cancelled (from_task))
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (!expand_application_parameters (info,
|
if (!expand_application_parameters (info,
|
||||||
command,
|
command,
|
||||||
&objs,
|
&objs,
|
||||||
@@ -5403,7 +5406,7 @@ launch_uris_async_thread (GTask *task,
|
|||||||
succeeded = g_win32_app_info_launch_uris_impl (appinfo, data->uris, data->context, task, &local_error);
|
succeeded = g_win32_app_info_launch_uris_impl (appinfo, data->uris, data->context, task, &local_error);
|
||||||
if (succeeded)
|
if (succeeded)
|
||||||
g_task_return_boolean (task, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
else
|
else if (!g_task_had_error (task))
|
||||||
g_task_return_error (task, g_steal_pointer (&local_error));
|
g_task_return_error (task, g_steal_pointer (&local_error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user