[gnome-boxes] display: connect_it() takes owership of OpenFDFunc



commit 5c653bbdf9158d1096030099150adcce52444c11
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon May 11 18:17:58 2015 +0100

    display: connect_it() takes owership of OpenFDFunc
    
    In the following patches, we'll need to keep the delegate around to use
    it from outside connect_it() but that won't be possible without this
    change since copying of delegates isn't supported by Vala.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746800

 src/display.vala         |    2 +-
 src/libvirt-machine.vala |    2 +-
 src/spice-display.vala   |    2 +-
 src/vnc-display.vala     |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/display.vala b/src/display.vala
index fe90632..ba9cd30 100644
--- a/src/display.vala
+++ b/src/display.vala
@@ -31,7 +31,7 @@ private abstract class Boxes.Display: GLib.Object, Boxes.IPropertiesProvider {
         return false;
     }
 
-    public abstract void connect_it (OpenFDFunc? open_fd = null) throws GLib.Error;
+    public abstract void connect_it (owned OpenFDFunc? open_fd = null) throws GLib.Error;
     public abstract void disconnect_it ();
 
     public virtual void collect_logs (StringBuilder builder) {
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index ee55f97..ab43324 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -80,7 +80,7 @@ private class Boxes.LibvirtMachine: Boxes.Machine {
                     }
                 };
 
-            display.connect_it (open_fd);
+            display.connect_it ((owned) open_fd);
         } else {
             show_display ();
             display.set_enable_audio (true);
diff --git a/src/spice-display.vala b/src/spice-display.vala
index 87e6ea1..cc6511b 100644
--- a/src/spice-display.vala
+++ b/src/spice-display.vala
@@ -191,7 +191,7 @@ private class Boxes.SpiceDisplay: Boxes.Display {
         }
     }
 
-    public override void connect_it (Display.OpenFDFunc? open_fd = null) {
+    public override void connect_it (owned Display.OpenFDFunc? open_fd = null) {
         // We only initiate connection once
         if (connected)
             return;
diff --git a/src/vnc-display.vala b/src/vnc-display.vala
index 8eae5b8..590edcc 100644
--- a/src/vnc-display.vala
+++ b/src/vnc-display.vala
@@ -114,7 +114,7 @@ private class Boxes.VncDisplay: Boxes.Display {
         return display.get_pixbuf ();
     }
 
-    public override void connect_it (Display.OpenFDFunc? open_fd = null) throws GLib.Error {
+    public override void connect_it (owned Display.OpenFDFunc? open_fd = null) throws GLib.Error {
         // We only initiate connection once
         if (connected)
             return;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]