Пример #1
0
        public void DisposeMemory()
        {
            var epm = new ExternalProcessMemory(Process.GetCurrentProcess());

            epm.Dispose();

            Assert.IsTrue(epm.IsDisposed);

            epm.Dispose();
        }
Пример #2
0
 /// <summary>
 ///     解除注入
 /// </summary>
 private void Detach()
 {
     try {
         if (Memory != null && !Memory.Process.HasExited)
         {
             Memory.Dispose();
         }
     }
     catch (Exception) {
         // ignored
     }
 }