Browse Source

Tensor.Creation: Added IntPtr.Zero check for FreeHGlobalMemory

tags/v0.12
Eli Belash 6 years ago
parent
commit
1d6f3de37d
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs

+ 1
- 1
src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs View File

@@ -664,7 +664,7 @@ namespace Tensorflow
[MonoPInvokeCallback(typeof(Deallocator))]
internal static void FreeHGlobalMemory(IntPtr dataPtr, IntPtr len, ref DeallocatorArgs args)
{
if (args.deallocator_called)
if (args.deallocator_called || dataPtr == IntPtr.Zero)
return;

// NumSharp will dispose


Loading…
Cancel
Save