From 4d2d52314790cf8ba63670b43afe47c6d798ff29 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Mon, 8 Feb 2016 22:28:02 +0100 Subject: [PATCH] Interop is no more static, so we have to provide an instance to SetValue... Oops! --- SharpPhysFS/Interop.cs | 2 +- Test/Program.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SharpPhysFS/Interop.cs b/SharpPhysFS/Interop.cs index c608c89..cbf2d0c 100644 --- a/SharpPhysFS/Interop.cs +++ b/SharpPhysFS/Interop.cs @@ -249,7 +249,7 @@ namespace SharpPhysFS var funcPtr = loadSymbol(library, field.Name); var del = Marshal.GetDelegateForFunctionPointer(funcPtr, field.FieldType); - field.SetValue(null, del); + field.SetValue(this, del); } } } diff --git a/Test/Program.cs b/Test/Program.cs index 73508e5..2d7be11 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -291,7 +291,9 @@ namespace Test Console.WriteLine("Usage: cat "); return false; } - using (var reader = new System.IO.StreamReader(physFS.OpenRead(args[0]))) + + using (var stream = physFS.OpenRead(args[0])) + using (var reader = new System.IO.StreamReader(stream)) { Console.WriteLine(reader.ReadToEnd()); }