Browse Source

Removed use of tf.Status static instance

In multithreading .NET 4.8 applications, sometimes in Session finalizer the method c_api.TF_DeleteSession find f.Status static instance already disposed for some reason. No problem for .NET 6 application or with a single thread.
tags/v0.100.4-load-saved-model
Superpiffer Haiping 2 years ago
parent
commit
43625abe91
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Sessions/BaseSession.cs

+ 1
- 1
src/TensorFlowNET.Core/Sessions/BaseSession.cs View File

@@ -291,7 +291,7 @@ namespace Tensorflow
protected override void DisposeUnmanagedResources(IntPtr handle)
{
// c_api.TF_CloseSession(handle, tf.Status.Handle);
c_api.TF_DeleteSession(handle, tf.Status.Handle);
c_api.TF_DeleteSession(handle, c_api.TF_NewStatus());
}
}
}

Loading…
Cancel
Save