[vala/0.40] glib-2.0: Avoid double-free in GLib.Array if clear_func is set



commit daefcf86606c60ebad67e0f0b1b350423bd24f14
Author: Corentin Noël <corentin elementary io>
Date:   Fri Nov 16 14:55:00 2018 +0100

    glib-2.0: Avoid double-free in GLib.Array if clear_func is set

 vapi/glib-2.0.vapi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 712d35ef7..4e488fc03 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -5278,14 +5278,14 @@ namespace GLib {
                [CCode (cname = "vala_g_array_remove_index")]
                public G remove_index (uint index) {
                        assert (length > index);
-                       G g = data[index];
+                       G g = (owned) data[index];
                        _remove_index (index);
                        return g;
                }
                [CCode (cname = "vala_g_array_remove_index_fast")]
                public G remove_index_fast (uint index) {
                        assert (length > index);
-                       G g = data[index];
+                       G g = (owned) data[index];
                        _remove_index_fast (index);
                        return g;
                }
@@ -5294,7 +5294,7 @@ namespace GLib {
                        assert (this.length >= index + length);
                        G[] ga = new G[length];
                        for (uint i = 0; i < length; i++) {
-                               ga[i] = data[i + index];
+                               ga[i] = (owned) data[i + index];
                        }
                        _remove_range (index, length);
                        return ga;


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