Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gnome-shell gnome-shell
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 2.1k
    • Issues 2.1k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 149
    • Merge requests 149
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gnome-shellgnome-shell
  • Merge requests
  • !1230

st/theme: Unref CRStylesheet after removing old theme nodes

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jonas Dreßler requested to merge verdre/gnome-shell:fix-that-last-crash into master May 01, 2020
  • Overview 2
  • Commits 1
  • Pipelines 4
  • Changes 1

Since we now remove all theme nodes on a stylesheet change (ie. StTheme's "custom-stylesheets-changed" signal) instead of only invalidating them, those nodes may not be accessed anymore as soon as "custom-stylesheets-changed" is emitted.

It turned out though that when comparing them to the newly generated nodes in st_widget_recompute_style() using the st_theme_node_paint/geometry_equal() functions, the properties of the old nodes will still be accessed, causing a crash since the CRDeclarations are already freed.

To fix that, keep the reference to the CRStylesheet, which owns the CRDeclarations used by the theme nodes, around a bit longer, so it's still possible to access the CRDeclarations inside the "custom-stylesheets-changed" signal handler. This allows us to compare the old theme nodes to the new ones since the CSS properties of both are still valid.

Fixes #2709 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-that-last-crash