Fixes some potential memory leaks in unit tests, cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-09-23 20:18:52 +02:00
parent 2b6b3a40ed
commit 4588b2da10
7 changed files with 29 additions and 20 deletions

View File

@@ -7,6 +7,12 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<WarningLevel>6</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors>;NU1605;CA2000</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<None Update="libpkmn_lib.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

View File

@@ -49,8 +49,8 @@ namespace PkmnLibSharp.Utils
return _ptr;
}
}
internal IntPtr TakeOwnership()
private IntPtr TakeOwnership()
{
if (!_isOwner)
{
@@ -67,17 +67,12 @@ namespace PkmnLibSharp.Utils
return ptr;
}
internal void Invalidate()
private void Invalidate()
{
_isInvalidated = true;
CacheHandler.RemoveCache(_ptr);
}
~ExternPointer()
{
Dispose();
}
public void Dispose()
{
if (_isDisposed)