Exemple #1
0
        public void Dispose()
        {
            var count = checked ((int)Array.Count.ToUInt32());

            for (int i = 0; i < count; i++)
            {
                EncodingMarshaler.Cleanup(Marshal.ReadIntPtr(Array.Strings, i * IntPtr.Size));
            }

            if (Array.Strings != IntPtr.Zero)
            {
                Marshal.FreeHGlobal(Array.Strings);
            }

            // Now that we've freed the memory, zero out the structure.
            Array.Reset();
        }
Exemple #2
0
 public void Dispose()
 {
     EncodingMarshaler.Cleanup(WorkDirPath);
     WorkDirPath = IntPtr.Zero;
 }