summaryrefslogtreecommitdiffstats
path: root/modules/mono
diff options
context:
space:
mode:
authorSami Kalliomäki <sami@kalliomaki.me>2023-09-02 21:22:23 +0100
committerSami Kalliomäki <sami@kalliomaki.me>2023-09-03 11:25:23 +0100
commit43a6748dfd7a8e798923534359a40fb7b3aa55dc (patch)
tree6b70b913e5d9045706fd5c69b08a9b8040b65cfd /modules/mono
parentd2ae309f2cec2000257c1ff203a64170fc146b17 (diff)
downloadredot-engine-43a6748dfd7a8e798923534359a40fb7b3aa55dc.tar.gz
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
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs12
1 files 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 5163ea5113..10aeeae995 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
/// </summary>
/// <param name="array">The objects to put in the new array.</param>
/// <returns>A new Godot Array.</returns>
- 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<StringName> array) : this()
+ public Array(Span<StringName> array)
{
if (array == null)
throw new ArgumentNullException(nameof(array));
@@ -84,7 +84,7 @@ namespace Godot.Collections
this[i] = array[i];
}
- public Array(Span<NodePath> array) : this()
+ public Array(Span<NodePath> array)
{
if (array == null)
throw new ArgumentNullException(nameof(array));
@@ -100,7 +100,7 @@ namespace Godot.Collections
this[i] = array[i];
}
- public Array(Span<Rid> array) : this()
+ public Array(Span<Rid> 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<GodotObject> array) : this()
+ public Array(ReadOnlySpan<GodotObject> array)
{
if (array == null)
throw new ArgumentNullException(nameof(array));
@@ -1057,7 +1057,7 @@ namespace Godot.Collections
/// </summary>
/// <param name="array">The items to put in the new array.</param>
/// <returns>A new Godot Array.</returns>
- public Array(T[] array) : this()
+ public Array(T[] array)
{
if (array == null)
throw new ArgumentNullException(nameof(array));