mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-27 07:05:50 +03:00
Prevent Utf8StringToNative.GetInstance getting optimized out
This commit is contained in:
parent
1e5dc7b2ea
commit
1a02a9c363
@ -31,6 +31,7 @@ public void Init()
|
||||
return;
|
||||
}
|
||||
|
||||
PreservationHack();
|
||||
throw new System.Exception( "Trying to initialize Steam Interface but Steam not initialized" );
|
||||
}
|
||||
|
||||
@ -109,5 +110,15 @@ internal virtual void Shutdown()
|
||||
}
|
||||
|
||||
public abstract void InitInternals();
|
||||
|
||||
internal void PreservationHack()
|
||||
{
|
||||
//
|
||||
// Stop Utf8StringToNative.GetInstance getting culled by stuff like Unity's
|
||||
// asselmbly optimization stuff. Here we just call it so it can't not exist.
|
||||
//
|
||||
var i = Utf8StringToNative.GetInstance( "don't cull this function" );
|
||||
i.GetNativeDataSize();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user