Skip to content

Commit 42c8520

Browse files
committed
Make EngineEventBusListener all SceneDisposable
1 parent c5debae commit 42c8520

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Glader.Essentials.GameFramework/Event/EventBus/EngineEventListener.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Glader.Essentials
1111
/// </summary>
1212
/// <typeparam name="TEventArgsType">The args type.</typeparam>
1313
/// <typeparam name="TSourceType">The source type.</typeparam>
14+
[SceneDisposable] // We force this and updated register code because we want to dispose everything to hopefully avoid leaks.
1415
public abstract class EngineEventBusListener<TEventArgsType, TSourceType> : EventBusListener<TEventArgsType, TSourceType>, IGameInitializable
1516
where TEventArgsType : IEventBusEventArgs
1617
{

src/Glader.Essentials.GameFramework/Modules/EngineInterfaceRegistrationModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected override void Load(ContainerBuilder builder)
7171
registrationBuilder = registrationBuilder
7272
.InstancePerLifetimeScope();
7373

74-
if(creatable.GetCustomAttribute<SceneDisposableAttribute>() != null)
74+
if(creatable.GetCustomAttribute<SceneDisposableAttribute>(true) != null)
7575
if (typeof(IDisposable).IsAssignableFrom(creatable))
7676
registrationBuilder = registrationBuilder.As<IDisposable>()
7777
.OwnedByLifetimeScope();

0 commit comments

Comments
 (0)