diff --git a/xalia/AtSpi2/AccessibleProvider.cs b/xalia/AtSpi2/AccessibleProvider.cs index 9015022..2aa85f3 100644 --- a/xalia/AtSpi2/AccessibleProvider.cs +++ b/xalia/AtSpi2/AccessibleProvider.cs @@ -912,9 +912,10 @@ public override bool WatchProperty(UiDomElement element, GudlExpression expressi case "spi_supported": if (!fetching_supported) { - fetching_supported = true; - wait_for_supported_task = FetchSupported(); - Utils.RunTask(wait_for_supported_task); + // Somehow, FetchSupported can complete without waiting, which + // would modify the providers list while it's being iterated to + // call WatchProperty, so delay it to prevent that. + Utils.RunIdle(DoFetchSupported); } break; case "spi_application": @@ -934,6 +935,16 @@ public override bool WatchProperty(UiDomElement element, GudlExpression expressi return false; } + private void DoFetchSupported() + { + if (!fetching_supported) + { + fetching_supported = true; + wait_for_supported_task = FetchSupported(); + Utils.RunTask(wait_for_supported_task); + } + } + private async Task FetchAttributes() { var old_change_count = attributes_change_count;