From 6e260b88a4994cf8abcee8571a522ee9a9900043 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Tue, 29 Sep 2015 10:39:12 +0200 Subject: [PATCH] - fixed bug in .net implementation. Garbage collected command termination handler. --- dotnet/IEC61850forCSharp/Control.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dotnet/IEC61850forCSharp/Control.cs b/dotnet/IEC61850forCSharp/Control.cs index d8bcc86d..cd425d88 100644 --- a/dotnet/IEC61850forCSharp/Control.cs +++ b/dotnet/IEC61850forCSharp/Control.cs @@ -164,6 +164,7 @@ namespace IEC61850 commandTerminationHandler(commandTerminationHandlerParameter, this); } + private InternalCommandTerminationHandler intCommandTerminationHandler; internal ControlObject (string objectReference, IntPtr connection, IedConnection iedConnection) { @@ -174,7 +175,7 @@ namespace IEC61850 if (this.controlObject == System.IntPtr.Zero) throw new IedConnectionException("Control object not found", 0); - InternalCommandTerminationHandler intCommandTerminationHandler = new InternalCommandTerminationHandler (MyCommandTerminationHandler); + intCommandTerminationHandler = new InternalCommandTerminationHandler (MyCommandTerminationHandler); ControlObjectClient_setCommandTerminationHandler(controlObject, intCommandTerminationHandler, controlObject); }