Fixes some potential memory leaks in unit tests, cleanup
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user