Binarysharp.MemoryManagement.Modules.ModuleFactory.Dispose C# (CSharp) Method

Dispose() public method

Releases all resources used by the ModuleFactory object.
public Dispose ( ) : void
return void
        public virtual void Dispose()
        {
            // Release all injected modules which must be disposed
            foreach (var injectedModule in InternalInjectedModules.Where(m => m.MustBeDisposed))
            {
                injectedModule.Dispose();
            }
            // Clean the cached functions related to this process
            foreach (var cachedFunction in RemoteModule.CachedFunctions.ToArray())
            {
                if (cachedFunction.Key.Item2 == MemorySharp.Handle)
                    RemoteModule.CachedFunctions.Remove(cachedFunction);
            }
            // Avoid the finalizer
            GC.SuppressFinalize(this);
        }