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.
pull/975/head
Superpiffer GitHub 2 years ago
parent
commit
d62520f9a1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
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