Skip to content

Commit

Permalink
Fix garbage produced by non-once listener and dispose error produced …
Browse files Browse the repository at this point in the history
…by non-once weak listeners
  • Loading branch information
Enderlook committed Feb 2, 2023
1 parent 3b254ad commit 6add943
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Changelog

##
## v0.4.7

- Fix `NullReferenceException` produced in Unity platform when `Raise` method is executed.

- Fix error when using raising listeners subscribed with `WeakSubscribe` and garbage being produced by non-`RaiseOnce` listeners.

## v0.4.6

Expand Down
2 changes: 1 addition & 1 deletion Enderlook.EventManager/Enderlook.EventManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Product>Enderlook.EventManager</Product>
<RepositoryUrl>https://github.com/Enderlook/Net-Event-Manager</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>0.4.6</Version>
<Version>0.4.7</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<LangVersion>11</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion Enderlook.EventManager/src/InvokersHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public override void Clear(Slice slice)

if (Utils.IsToggled<TIsOnce>())
{
ArrayUtils.ReturnArray(callbacks_, slice.Count);
#if NET7_0_OR_GREATER
TCallbackHelper
#elif UNITY
Expand All @@ -107,6 +106,7 @@ public override void Clear(Slice slice)
#endif
.Dispose(callbacks_, slice.Count);
}
ArrayUtils.ReturnArray(callbacks_, slice.Count);
}

public override void Raise(Slice slice, TEvent argument)
Expand Down

0 comments on commit 6add943

Please sign in to comment.