mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-05-07 12:19:40 +03:00
Fixed NRE in inventory result dispose
This commit is contained in:
parent
2ee5fa4a5d
commit
c4617c5884
@ -14,7 +14,7 @@ namespace Facepunch.Steamworks
|
|||||||
internal static Dictionary< int, Result > Pending;
|
internal static Dictionary< int, Result > Pending;
|
||||||
internal Inventory inventory;
|
internal Inventory inventory;
|
||||||
|
|
||||||
private SteamNative.SteamInventoryResult_t Handle { get; set; }
|
private SteamNative.SteamInventoryResult_t Handle { get; set; } = -1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when result is successfully returned
|
/// Called when result is successfully returned
|
||||||
@ -169,8 +169,12 @@ namespace Facepunch.Steamworks
|
|||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
inventory.inventory.DestroyResult( Handle );
|
if ( Handle != -1 && inventory != null )
|
||||||
Handle = -1;
|
{
|
||||||
|
inventory.inventory.DestroyResult( Handle );
|
||||||
|
Handle = -1;
|
||||||
|
}
|
||||||
|
|
||||||
inventory = null;
|
inventory = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user