From 9fde2fde5a03d6ae73cf4d0ffadca0aa685e1e64 Mon Sep 17 00:00:00 2001 From: siimav Date: Tue, 11 Jun 2024 01:01:01 +0300 Subject: [PATCH] Fix a GameEvents leak --- src/RealAntennasProject/ModuleRealAntenna.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/RealAntennasProject/ModuleRealAntenna.cs b/src/RealAntennasProject/ModuleRealAntenna.cs index 52584f3..7fef1d4 100644 --- a/src/RealAntennasProject/ModuleRealAntenna.cs +++ b/src/RealAntennasProject/ModuleRealAntenna.cs @@ -114,6 +114,11 @@ public override void OnSave(ConfigNode node) RAAntenna.Target?.Save(node); } + public void OnDestroy() + { + GameEvents.OnGameSettingsApplied.Remove(ApplyGameSettings); + } + public void Configure(ConfigNode node) { RAAntenna.Name = part.partInfo?.title ?? part.name;