From 619b91d49aa2c0aba0d2605d00c8ae4d0d1a27f1 Mon Sep 17 00:00:00 2001 From: James Frowen Date: Fri, 29 Mar 2024 21:05:39 +0000 Subject: [PATCH] fix: fixing AddLateEvent tmp list since list is static, invoking a 2nd AddLateEvent from an event would re-use the tmp list and throw --- Assets/Mirage/Runtime/Events/AddLateEvent.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Mirage/Runtime/Events/AddLateEvent.cs b/Assets/Mirage/Runtime/Events/AddLateEvent.cs index 25e6e9b93a..93b610b0b4 100644 --- a/Assets/Mirage/Runtime/Events/AddLateEvent.cs +++ b/Assets/Mirage/Runtime/Events/AddLateEvent.cs @@ -68,7 +68,7 @@ namespace Mirage.Events [Serializable] public class AddLateEvent : AddLateEventBase, IAddLateEvent { - private static readonly List tmp = new List(); + private readonly List tmp = new List(); private readonly List _listeners = new List(); public void AddListener(Action handler) @@ -109,7 +109,7 @@ public virtual void Invoke() [Serializable] public class AddLateEvent : AddLateEventBase, IAddLateEvent { - private static readonly List> tmp = new List>(); + private readonly List> tmp = new List>(); private readonly List> _listeners = new List>(); protected T0 _arg0; @@ -154,7 +154,7 @@ public virtual void Invoke(T0 arg0) [Serializable] public class AddLateEvent : AddLateEventBase, IAddLateEvent { - private static readonly List> tmp = new List>(); + private readonly List> tmp = new List>(); private readonly List> _listeners = new List>(); protected T0 _arg0;