Skip to content

Commit

Permalink
AtSpi2: Fix a crash when fetching supported interfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
madewokherd committed Apr 13, 2024
1 parent e5a4c63 commit 17a2bb9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions xalia/AtSpi2/AccessibleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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;
Expand Down

0 comments on commit 17a2bb9

Please sign in to comment.