Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MemoryMappedViewAccessor.cs
Go to the documentation of this file.
2
4
6{
7 private readonly MemoryMappedView _view;
8
10
12
18
19 protected override void Dispose(bool disposing)
20 {
21 try
22 {
23 if (disposing && !_view.IsClosed)
24 {
25 Flush();
26 }
27 }
28 finally
29 {
30 try
31 {
32 _view.Dispose();
33 }
34 finally
35 {
36 base.Dispose(disposing);
37 }
38 }
39 }
40
41 public void Flush()
42 {
43 if (!base.IsOpen)
44 {
45 throw new ObjectDisposedException("MemoryMappedViewAccessor", System.SR.ObjectDisposed_ViewAccessorClosed);
46 }
47 _view.Flush((UIntPtr)(ulong)base.Capacity);
48 }
49}
static FileAccess GetFileAccess(MemoryMappedFileAccess access)
unsafe void Initialize(SafeBuffer buffer, long offset, long capacity, FileAccess access)
static string ObjectDisposed_ViewAccessorClosed
Definition SR.cs:70
Definition SR.cs:7