Skip to content

Commit 43625ab

Browse files
SuperpifferOceania2018
authored andcommitted
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.
1 parent c5cdf2c commit 43625ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TensorFlowNET.Core/Sessions/BaseSession.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ private void _extend_graph()
291291
protected override void DisposeUnmanagedResources(IntPtr handle)
292292
{
293293
// c_api.TF_CloseSession(handle, tf.Status.Handle);
294-
c_api.TF_DeleteSession(handle, tf.Status.Handle);
294+
c_api.TF_DeleteSession(handle, c_api.TF_NewStatus());
295295
}
296296
}
297297
}

0 commit comments

Comments
 (0)