Fixes memory leaks
This commit is contained in:
parent
35388de524
commit
25d72e14f9
|
@ -62,10 +62,10 @@ namespace PkmnLibSharp.Library
|
||||||
{
|
{
|
||||||
fixed (IntPtr* hab = hiddenAbilitiesConverted)
|
fixed (IntPtr* hab = hiddenAbilitiesConverted)
|
||||||
{
|
{
|
||||||
var ptr = SpeciesVariant.Construct(name, height, weight, baseExperience, (IntPtr)t,
|
var ptr = SpeciesVariant.Construct(name, height, weight, baseExperience, (IntPtr) t,
|
||||||
(ulong) types.Length,
|
(ulong) types.Length,
|
||||||
baseHealth, baseAttack, baseDefense, baseSpecialAttack, baseSpecialDefense,
|
baseHealth, baseAttack, baseDefense, baseSpecialAttack, baseSpecialDefense,
|
||||||
baseSpeed, (IntPtr)ab, (ulong) abilities.Length, (IntPtr)hab,
|
baseSpeed, (IntPtr) ab, (ulong) abilities.Length, (IntPtr) hab,
|
||||||
(ulong) hiddenAbilities.Length, IntPtr.Zero);
|
(ulong) hiddenAbilities.Length, IntPtr.Zero);
|
||||||
var f = new Forme(ptr);
|
var f = new Forme(ptr);
|
||||||
foreach (var intPtr in abilitiesConverted)
|
foreach (var intPtr in abilitiesConverted)
|
||||||
|
@ -78,8 +78,7 @@ namespace PkmnLibSharp.Library
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Forme(IntPtr parent)
|
private Forme(IntPtr parent) : base(parent)
|
||||||
: base(parent)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ namespace PkmnLibSharp
|
||||||
public abstract class PointerWrapper : IDisposable
|
public abstract class PointerWrapper : IDisposable
|
||||||
{
|
{
|
||||||
internal readonly IntPtr Ptr;
|
internal readonly IntPtr Ptr;
|
||||||
private bool _isDeleted = true;
|
private bool _isDeleted = false;
|
||||||
|
|
||||||
protected PointerWrapper(IntPtr ptr)
|
protected PointerWrapper(IntPtr ptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue