mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
wayland: Fix weak ref tracking on data sources
We may get a NULL one here, and we're wrongly attempting to remove the old weak ref from the new data source object.
This commit is contained in:
parent
405f1ce3d0
commit
cf88675807
@ -743,12 +743,14 @@ meta_wayland_data_device_set_dnd_source (MetaWaylandDataDevice *data_device,
|
||||
return;
|
||||
|
||||
if (data_device->dnd_data_source)
|
||||
g_object_remove_weak_pointer (G_OBJECT (source),
|
||||
g_object_remove_weak_pointer (G_OBJECT (data_device->dnd_data_source),
|
||||
(gpointer *)&data_device->dnd_data_source);
|
||||
|
||||
data_device->dnd_data_source = source;
|
||||
g_object_add_weak_pointer (G_OBJECT (source),
|
||||
(gpointer *)&data_device->dnd_data_source);
|
||||
|
||||
if (source)
|
||||
g_object_add_weak_pointer (G_OBJECT (data_device->dnd_data_source),
|
||||
(gpointer *)&data_device->dnd_data_source);
|
||||
|
||||
wl_signal_emit (&data_device->dnd_ownership_signal, source);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user