[gnome-builder/gnome-builder-3-28] vala: Avoid ownership mismatches of container elements to fix some memleaks



commit ce55b5b281b9003089d57743c5258ca9a4f1c8f2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Apr 5 10:34:41 2018 +0200

    vala: Avoid ownership mismatches of container elements to fix some memleaks

 src/plugins/vala-pack/ide-vala-index.vala       | 2 +-
 src/plugins/vala-pack/ide-vala-source-file.vala | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/vala-pack/ide-vala-index.vala b/src/plugins/vala-pack/ide-vala-index.vala
index 287c4e129..41fd64eb5 100644
--- a/src/plugins/vala-pack/ide-vala-index.vala
+++ b/src/plugins/vala-pack/ide-vala-index.vala
@@ -284,7 +284,7 @@ namespace Ide
                                              GLib.Cancellable? cancellable)
                        throws GLib.Error
                {
-                       GLib.GenericArray<UnsavedFile>? unsaved_files_copy = null;
+                       GLib.GenericArray<unowned UnsavedFile>? unsaved_files_copy = null;
 
                        if (unsaved_files != null) {
                                unsaved_files_copy = unsaved_files.to_array ();
diff --git a/src/plugins/vala-pack/ide-vala-source-file.vala b/src/plugins/vala-pack/ide-vala-source-file.vala
index 549fa5abc..b0d63eb0e 100644
--- a/src/plugins/vala-pack/ide-vala-source-file.vala
+++ b/src/plugins/vala-pack/ide-vala-source-file.vala
@@ -135,7 +135,7 @@ namespace Ide
 
                public Ide.Diagnostics? diagnose ()
                {
-                       var ar = new GLib.GenericArray<Ide.Diagnostic> ();
+                       var ar = new GLib.GenericArray<unowned Ide.Diagnostic> ();
                        foreach (var diag in this.diagnostics) {
                                ar.add (diag);
                        }


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