Commit 963264a7 authored by Benjamin Otte's avatar Benjamin Otte

gdk: Fix wrong usage of g_task_propagate_pointer()

The return value is transfer full, not transfer none.
parent 234d3436
......@@ -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 (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;
}
if (out_mime_type)
*out_mime_type = g_task_get_task_data (task);
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment