When we fall back to the default cursor and load it
from a resource, we need to free the texture.
cairo_surface_t *surface;
struct wl_buffer *buffer;
- texture = gdk_cursor_get_texture (cursor);
+ texture = g_object_ref (gdk_cursor_get_texture (cursor));
from_texture:
surface = g_hash_table_lookup (display->cursor_surface_cache, cursor);
buffer = _gdk_wayland_shm_surface_get_wl_buffer (surface);
wl_buffer_add_listener (buffer, &buffer_listener, surface);
+ g_object_unref (texture);
+
return buffer;
}