Skip to content
Snippets Groups Projects

qt: fix crash with Wayland on close if the surface is invalidated by Qt

Merged Fatih Uzunoğlu requested to merge fuzun/vlc:qt/waylandcrashfix into master
All threads resolved!

If we allow Qt to close the interface window, the underlying "window" (surface in Wayland case) may be gone when it is still necessary by the application.

With Wayland, idle inhibitor needs the surface to initialize, so the surface must outlive the inhibitor. However, without the change proposed here, the inhibitor (zwp_idle_inhibitor_v1) may be destroyed after Qt is closed.

  1. Start the interface.
  2. Play a video.
  3. Stop the player.
  4. Close the interface.
  5. ** Crash **

This change should be fine, as we destroy the window ourselves anyway (at correct time) and destroying the window obviously closes it.

Edited by Fatih Uzunoğlu

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Author Reporter
      Resolved by Pierre Lamot

      Now that the window closes only during destruction, does it make sense to close the window and wait for it instead of "closing" it via destruction in unloadGUI()? I'm not sure if window manager/compositor expects every window to be closed safely before destruction, I'm also not sure if Qt does that already itself.

      Edited by Fatih Uzunoğlu
    • Please register or sign in to reply
  • added 1 commit

    • 761eed3f - qt: do not let qt to close the interface window itself

    Compare with previous version

  • Pierre Lamot approved this merge request

    approved this merge request

  • Pierre Lamot resolved all threads

    resolved all threads

  • MR Acceptance result

    :tada: This MergeRequest has been Accepted! Congratulations.

    MR acceptance checks details:

    • :white_check_mark: MR should be considered mergeable by Gitlab
    • :white_check_mark: Last pipeline should be successful
    • :white_check_mark: MergeRequest should have at least one external review and/or vote
    • :white_check_mark: All threads should be resolved, have votes and score > 0
    • :white_check_mark: MergeRequest should have no activity (threads/votes) for (72h/72h)

    This message was automatically generated by homer-bot.

  • Steve Lhomme added 532 commits

    added 532 commits

    Compare with previous version

  • Steve Lhomme enabled an automatic merge when all merge checks for b83603de pass

    enabled an automatic merge when all merge checks for b83603de pass

  • merged

  • Please register or sign in to reply
    Loading