Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mirrors: Run speed tests as GTask async operations #257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MavChtz
Copy link

@MavChtz MavChtz commented Jan 21, 2025

Quickly opening and closing the mirror selection dialog repeatedly has a chance of causing a segfault. In addition, the following Gtk critical error message is printed multiple times for every mirror that has not yet been tested at the time that the dialog is closed.
Gtk-CRITICAL **: gtk_list_store_get_value: assertion 'iter_is_valid (iter, list_store)' failed.

This occurs because the mirrors model gets cleared without waiting for the speed test thread to finish thus invalidating the remaining iterators.

The speed tests are now run using Gio Task async operations. They are launched in new threads and when complete, the callback which is invoked from the main thread checks if the task has been cancelled and if so it does not modify the model or access the now invalid iterators.

Quickly opening and closing the mirror selection dialog repeatedly has
a chance of causing a segfault. In addition, the following Gtk critical
error message is printed multiple times for every mirror that has not yet
been tested at the time that the dialog is closed.
Gtk-CRITICAL **: gtk_list_store_get_value: assertion 'iter_is_valid (iter, list_store)' failed.

This occurs because the mirrors model gets cleared without waiting for the
speed test thread to finish thus invalidating the remaining iterators.

The speed tests are now run using Gio Task async operations.
They are launched in new threads and when complete, the callback which
is invoked from the main thread checks if the task has been cancelled
and if so it does not modify the model or access the now invalid iterators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant