コード例 #1
0
ファイル: Session.cs プロジェクト: mackenbaron/emgutf
 /// <summary>
 /// Release the unmanaged memory associated with this Session.
 /// </summary>
 protected override void DisposeObject()
 {
     if (IntPtr.Zero != _ptr)
     {
         using (StatusChecker checker = new StatusChecker(null))
             TfInvoke.tfeDeleteSession(ref _ptr, checker.Status);
     }
 }
コード例 #2
0
        /// <summary>
        /// Release the unmanaged memory associated with this Session.
        /// </summary>
        protected override void DisposeObject()
        {
            if (IntPtr.Zero != _ptr)
            {
                using (StatusChecker checker = new StatusChecker(null))
                    TfInvoke.tfeDeleteSession(ref _ptr, checker.Status);
            }

            if (_graphNeedDispose && _graph != null)
            {
                _graph.Dispose();
                _graph = null;
            }

            if (_metaGraphDef != null)
            {
                _metaGraphDef.Dispose();
                _metaGraphDef = null;
            }

            _graph = null;
        }