Skip to content

Commit ddfc0ee

Browse files
committed
Version 1.0.5: Fixed a bug with UnmanagedString that made it impossible to retrieve the string value.
1 parent b10dd03 commit ddfc0ee

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ Allows to manipulate array of unmanaged pointers with the `UnmanagedArrayPointer
2222
* Added the `UnmanagedPointerArray<T>` struct used to manipulate array of pointers.
2323
* Marked all properties as `readonly` as they don't modify the state of the structs.
2424
* Use the new `namespace` syntax for less indentation levels.
25+
26+
### Version 1.0.5
27+
28+
* Fixed an issue that made it impossible to retrieve the string value of an `UnmanagedString` with the `ToString` method.

UnmanagedMemoryUtils/UnmanagedMemoryUtils/UnmanagedMemoryUtils.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
88
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
99
<Title>UnmanagedMemoryUtils</Title>
10-
<VersionPrefix>1.0.4</VersionPrefix>
10+
<VersionPrefix>1.0.5</VersionPrefix>
1111
<PackageReadmeFile>README.md</PackageReadmeFile>
1212
<Description>A .NET collection of utilities for working with unmanaged memory.
1313
Provides faster alternatives to Memory&lt;T&gt; and ReadOnlyMemory&lt;T&gt; in addition to accessing unmanaged string from managed code.
@@ -30,7 +30,11 @@ Version 1.0.4
3030

3131
* Added the UnmanagedPointerArray&lt;T&gt; struct used to manipulate array of pointers.
3232
* Marked all properties as 'readonly' as they don't modify the state of the structs.
33-
* Use the new 'namespace' syntax for less indentation levels.</PackageReleaseNotes>
33+
* Use the new 'namespace' syntax for less indentation levels.
34+
35+
Version 1.0.5
36+
37+
* Fixed an issue that made it impossible to retrieve the string value of an UnmanagedString with the 'ToString' method.</PackageReleaseNotes>
3438
</PropertyGroup>
3539
<ItemGroup>
3640
<None Include="..\..\README.md" Pack="true" PackagePath="\" />

UnmanagedMemoryUtils/UnmanagedMemoryUtils/UnmanagedString.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void Free()
121121

122122
public override readonly string ToString()
123123
{
124-
if (Pointer != nint.Zero) return string.Empty;
124+
if (Pointer == nint.Zero) return string.Empty;
125125
return m_Marshaller.Invoke(Pointer) ?? string.Empty;
126126
}
127127

0 commit comments

Comments
 (0)