Interop is no more static, so we have to provide an instance to SetValue... Oops!

pull/2/head
Francesco Bertolaccini 2016-02-08 22:28:02 +01:00
parent 1fce35a11c
commit 4d2d523147
2 changed files with 4 additions and 2 deletions

View File

@ -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);
}
}
}

View File

@ -291,7 +291,9 @@ namespace Test
Console.WriteLine("Usage: cat <file>");
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());
}