mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 11:50:21 +00:00
gdk: Fix wrong usage of g_task_propagate_pointer()
The return value is transfer full, not transfer none.
This commit is contained in:
parent
234d34366a
commit
963264a73a
@ -251,28 +251,16 @@ gdk_wayland_clipboard_read_finish (GdkClipboard *clipboard,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
GInputStream *stream;
|
||||
GTask *task;
|
||||
|
||||
g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (clipboard)), NULL);
|
||||
task = G_TASK (result);
|
||||
g_return_val_if_fail (g_task_get_source_tag (task) == gdk_wayland_clipboard_read_async, NULL);
|
||||
|
||||
stream = g_task_propagate_pointer (task, error);
|
||||
if (out_mime_type)
|
||||
*out_mime_type = g_task_get_task_data (task);
|
||||
|
||||
if (stream)
|
||||
{
|
||||
if (out_mime_type)
|
||||
*out_mime_type = g_task_get_task_data (task);
|
||||
g_object_ref (stream);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (out_mime_type)
|
||||
*out_mime_type = NULL;
|
||||
}
|
||||
|
||||
return stream;
|
||||
return g_task_propagate_pointer (task, error);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1062,33 +1062,21 @@ gdk_x11_clipboard_read_finish (GdkClipboard *clipboard,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
GInputStream *stream;
|
||||
GTask *task;
|
||||
|
||||
g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (clipboard)), NULL);
|
||||
task = G_TASK (result);
|
||||
g_return_val_if_fail (g_task_get_source_tag (task) == gdk_x11_clipboard_read_async, NULL);
|
||||
|
||||
stream = g_task_propagate_pointer (task, error);
|
||||
|
||||
if (stream)
|
||||
if (out_mime_type)
|
||||
{
|
||||
if (out_mime_type)
|
||||
{
|
||||
GSList *targets;
|
||||
GSList *targets;
|
||||
|
||||
targets = g_task_get_task_data (task);
|
||||
*out_mime_type = targets->data;
|
||||
}
|
||||
g_object_ref (stream);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (out_mime_type)
|
||||
*out_mime_type = NULL;
|
||||
targets = g_task_get_task_data (task);
|
||||
*out_mime_type = targets ? targets->data : NULL;
|
||||
}
|
||||
|
||||
return stream;
|
||||
return g_task_propagate_pointer (task, error);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user