コード例 #1
0
ファイル: EngineFactory.cs プロジェクト: claro5/HRFace2_0
 /// <summary>
 /// 释放引擎Handler
 /// </summary>
 /// <returns></returns>
 public static bool DisposeEngine()
 {
     if (hEngine != null)
     {
         try
         {
             ResultCode result = (ResultCode)ASFAPI.ASFUninitEngine(hEngine);
             if (result == ResultCode.成功)
             {
                 return(true);
             }
             else
             {
                 throw new Exception(result.ToString());
             }
         }
         catch (Exception ex)
         {
             throw ex;
         }
         finally
         {
             //Marshal.FreeHGlobal(hEngine);
         }
     }
     return(true);
 }
コード例 #2
0
 /// <summary>
 /// 释放引擎Handler
 /// </summary>
 /// <returns></returns>
 public static bool DisposeEngine()
 {
     if (hEngine != IntPtr.Zero)
     {
         try
         {
             ResultCode result = (ResultCode)ASFAPI.ASFUninitEngine(hEngine);
             if (result == ResultCode.成功)
             {
                 return(true);
             }
             else
             {
                 throw new Exception(result.ToString());
             }
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
     return(true);
 }