From c26722badf4836bacf6d44aef6352106bc363c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Kalliom=C3=A4ki?= Date: Sat, 2 Sep 2023 21:22:23 +0100 Subject: [PATCH] Do not call Array default constructor when not necessary. This fixes a bug where Array would get registered twice with the DisposablesTracker causing an exception on shutdown. Fixes #81231 (cherry picked from commit 43a6748dfd7a8e798923534359a40fb7b3aa55dc) --- .../mono/glue/GodotSharp/GodotSharp/Core/Array.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs index 5163ea51139..10aeeae995a 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs @@ -52,7 +52,7 @@ namespace Godot.Collections /// /// The objects to put in the new array. /// A new Godot Array. - public Array(Variant[] array) : this() + public Array(Variant[] array) { if (array == null) throw new ArgumentNullException(nameof(array)); @@ -68,7 +68,7 @@ namespace Godot.Collections this[i] = array[i]; } - public Array(Span array) : this() + public Array(Span array) { if (array == null) throw new ArgumentNullException(nameof(array)); @@ -84,7 +84,7 @@ namespace Godot.Collections this[i] = array[i]; } - public Array(Span array) : this() + public Array(Span array) { if (array == null) throw new ArgumentNullException(nameof(array)); @@ -100,7 +100,7 @@ namespace Godot.Collections this[i] = array[i]; } - public Array(Span array) : this() + public Array(Span array) { if (array == null) throw new ArgumentNullException(nameof(array)); @@ -121,7 +121,7 @@ namespace Godot.Collections // fine as long as the array is not mutated. However, Span does this type checking at // instantiation, so it's not possible to use it even when not mutating anything. // ReSharper disable once RedundantNameQualifier - public Array(ReadOnlySpan array) : this() + public Array(ReadOnlySpan array) { if (array == null) throw new ArgumentNullException(nameof(array)); @@ -1057,7 +1057,7 @@ namespace Godot.Collections /// /// The items to put in the new array. /// A new Godot Array. - public Array(T[] array) : this() + public Array(T[] array) { if (array == null) throw new ArgumentNullException(nameof(array));