From 1be1d471222b6d3763df1ad9b9d3b631ac8185f1 Mon Sep 17 00:00:00 2001 From: hrxi Date: Mon, 22 Jul 2019 10:41:26 +0200 Subject: Fix a couple of delegate copy warnigs "warning: copying delegates is not supported" --- xmpp-vala/src/module/xep/0047_in_band_bytestreams.vala | 8 ++++---- xmpp-vala/src/module/xep/0166_jingle.vala | 2 +- xmpp-vala/src/module/xep/0313_message_archive_management.vala | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xmpp-vala/src/module/xep/0047_in_band_bytestreams.vala b/xmpp-vala/src/module/xep/0047_in_band_bytestreams.vala index 9af9f30e..5d59d18c 100644 --- a/xmpp-vala/src/module/xep/0047_in_band_bytestreams.vala +++ b/xmpp-vala/src/module/xep/0047_in_band_bytestreams.vala @@ -149,25 +149,25 @@ public class Connection : IOStream { output = new Output(this); } - public void set_read_callback(SourceFunc callback, Cancellable? cancellable, int io_priority) throws IOError { + public void set_read_callback(owned SourceFunc callback, Cancellable? cancellable, int io_priority) throws IOError { if (read_callback != null) { throw new IOError.PENDING("only one async read is permitted at a time on an in-band bytestream"); } if (cancellable != null) { read_callback_cancellable_id = cancellable.connect(trigger_read_callback); } - read_callback = callback; + read_callback = (owned)callback; read_callback_cancellable = cancellable; read_callback_priority = io_priority; } - public void set_write_callback(SourceFunc callback, Cancellable? cancellable, int io_priority) throws IOError { + public void set_write_callback(owned SourceFunc callback, Cancellable? cancellable, int io_priority) throws IOError { if (write_callback != null) { throw new IOError.PENDING("only one async write is permitted at a time on an in-band bytestream"); } if (cancellable != null) { write_callback_cancellable_id = cancellable.connect(trigger_write_callback); } - write_callback = callback; + write_callback = (owned)callback; write_callback_cancellable = cancellable; write_callback_priority = io_priority; } diff --git a/xmpp-vala/src/module/xep/0166_jingle.vala b/xmpp-vala/src/module/xep/0166_jingle.vala index ee7df994..4d9a472a 100644 --- a/xmpp-vala/src/module/xep/0166_jingle.vala +++ b/xmpp-vala/src/module/xep/0166_jingle.vala @@ -567,7 +567,7 @@ public class Connection : IOStream { } SourceFunc callback = wait_and_check_for_errors.callback; ulong id = cancellable.connect(() => callback()); - callbacks.add(new OnSetInnerCallback() { callback=callback, io_priority=io_priority}); + callbacks.add(new OnSetInnerCallback() { callback=(owned)callback, io_priority=io_priority}); yield; cancellable.disconnect(id); } diff --git a/xmpp-vala/src/module/xep/0313_message_archive_management.vala b/xmpp-vala/src/module/xep/0313_message_archive_management.vala index 00f8f99b..674224c9 100644 --- a/xmpp-vala/src/module/xep/0313_message_archive_management.vala +++ b/xmpp-vala/src/module/xep/0313_message_archive_management.vala @@ -39,7 +39,7 @@ public class Module : XmppStreamModule { } StanzaNode query_node = new StanzaNode.build("query", NS_VER(stream)).add_self_xmlns().put_node(data_form.get_submit_node()); Iq.Stanza iq = new Iq.Stanza.set(query_node); - stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, (stream, iq) => { page_through_results(stream, iq, on_finished); }); + stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, (stream, iq) => { page_through_results(stream, iq, (owned)on_finished); }); } public override void attach(XmppStream stream) { @@ -69,7 +69,7 @@ public class Module : XmppStreamModule { ) ) ); - stream.get_module(Iq.Module.IDENTITY).send_iq(stream, paging_iq, (stream, iq) => { page_through_results(stream, iq, on_finished); }); + stream.get_module(Iq.Module.IDENTITY).send_iq(stream, paging_iq, (stream, iq) => { page_through_results(stream, iq, (owned)on_finished); }); } private void query_availability(XmppStream stream) { -- cgit v1.2.3-70-g09d2