Skip to content

portal: Check if the monitor is closed before emitting progress - #6692

Merged
swick merged 1 commit into
flatpak:mainfrom
swick:wip/portal-update-progress-closed
Jun 23, 2026
Merged

swick merged 1 commit into
flatpak:mainfrom
swick:wip/portal-update-progress-closed

Conversation

@swick

@swick swick commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

emit_progress is called from a thread while another thread could unexport/close the GDbusInterfaceSkeleton. If that happens, the connection becomes NULL which is illegal for
g_dbus_connection_emit_signal which results in dereferencing an unset error.

The fix is to lock the UpdateMonitorData, and then only emit the signal if it is not closed.

`emit_progress` is called from a thread while another thread could
unexport/close the GDbusInterfaceSkeleton. If that happens, the
connection becomes NULL which is illegal for
`g_dbus_connection_emit_signal` which results in dereferencing an unset
error.

The fix is to lock the UpdateMonitorData, and then only emit the signal
if it is not closed.
@hsitter

hsitter commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Can confirm this fixes crash #6686

@swick
swick marked this pull request as ready for review June 15, 2026 09:49
@swick
swick added this pull request to the merge queue Jun 23, 2026
Merged via the queue into flatpak:main with commit ce4a27e Jun 23, 2026
11 checks passed
@swick
swick deleted the wip/portal-update-progress-closed branch June 23, 2026 08:53
@Pointedstick

Copy link
Copy Markdown

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants