diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-11-17 14:07:20 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-11-17 17:22:18 +0100 |
commit | 1790320ba3063ed1661cd7ca1e8590ac4ab901a6 (patch) | |
tree | d0357e0d5d6b54a26362bf0ae20241756da2263e | |
parent | f45df4265d089dc4df22a411161db53e5a06bff7 (diff) | |
download | mutter-1790320ba3063ed1661cd7ca1e8590ac4ab901a6.tar.gz |
backends: Protect from reentrancy in meta_cursor_sprite_load_from_theme
This function is supposedly not failable, so just move the theme_dirty
flag clearing to the beginning of the function. Protects against cases
where requesting a cursor image may result in it being loaded and set
as a texture, which emits ::texture-changed, which may end up requesting
the cursor image again.
https://bugzilla.gnome.org/show_bug.cgi?id=754806
-rw-r--r-- | src/backends/meta-cursor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c index ccd0ab017..beeee765b 100644 --- a/src/backends/meta-cursor.c +++ b/src/backends/meta-cursor.c @@ -229,6 +229,8 @@ meta_cursor_sprite_load_from_theme (MetaCursorSprite *self) g_assert (self->cursor != META_CURSOR_NONE); + self->theme_dirty = FALSE; + /* We might be reloading with a different scale. If so clear the old data. */ if (self->xcursor_images) { @@ -244,8 +246,6 @@ meta_cursor_sprite_load_from_theme (MetaCursorSprite *self) image = meta_cursor_sprite_get_current_frame_image (self); meta_cursor_sprite_load_from_xcursor_image (self, image); - - self->theme_dirty = FALSE; } MetaCursorSprite * |