- .NET API: added TLSConfiguration destructor

pull/143/head
Michael Zillgith 8 years ago
parent 6c588a9a3a
commit 6c218db778

@ -474,9 +474,9 @@ namespace IEC61850
public IntPtr self = IntPtr.Zero;
public ReportControlBlock(string name, LogicalNode parent, string rptId, bool isBuffered,
string dataSetName, uint confRef, byte trgOps, byte options, uint bufTm, uint intgPd)
string dataSetName, uint confRev, byte trgOps, byte options, uint bufTm, uint intgPd)
{
self = ReportControlBlock_create(name, parent.self, rptId, isBuffered, dataSetName, confRef, trgOps, options, bufTm, intgPd);
self = ReportControlBlock_create(name, parent.self, rptId, isBuffered, dataSetName, confRev, trgOps, options, bufTm, intgPd);
}
}

@ -430,9 +430,13 @@ namespace IEC61850
public MmsDataAccessError GetDataAccessError ()
{
int errorCode = MmsValue_getDataAccessError (valueReference);
if (GetType () == MmsType.MMS_DATA_ACCESS_ERROR) {
int errorCode = MmsValue_getDataAccessError (valueReference);
return (MmsDataAccessError)errorCode;
return (MmsDataAccessError)errorCode;
}
else
throw new MmsValueException ("Value is of wrong type");
}
/// <summary>

@ -90,6 +90,11 @@ namespace IEC61850
self = TLSConfiguration_create ();
}
~TLSConfiguration()
{
Dispose ();
}
internal IntPtr GetNativeInstance()
{
return self;
@ -197,7 +202,12 @@ namespace IEC61850
public void Dispose()
{
TLSConfiguration_destroy (self);
lock (self) {
if (self != IntPtr.Zero) {
TLSConfiguration_destroy (self);
self = IntPtr.Zero;
}
}
}
}

Loading…
Cancel
Save