The entire call is skipped in release mode if you place it inside a Debug.Assert.
This commit is contained in:
parent
a6deee765f
commit
a2185d9ef0
|
@ -63,7 +63,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
tuple =>
|
||||
{
|
||||
var instance = tuple.Ctor.Invoke(tuple.CtorTypes.Select(t => avail[t]).ToArray());
|
||||
Debug.Assert(ServiceInjector.UpdateServices(serviceProvider, instance, mayCache: true));
|
||||
var success = ServiceInjector.UpdateServices(serviceProvider, instance, mayCache: true);
|
||||
Debug.Assert(success);
|
||||
_ = success;
|
||||
return (IExternalApi) instance;
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -66,7 +66,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|| lib.GetCustomAttribute<LuaLibraryAttribute>(inherit: false)?.Released is not false)
|
||||
{
|
||||
var instance = (LuaLibraryBase)Activator.CreateInstance(lib, this, _apiContainer, (Action<string>)LogToLuaConsole);
|
||||
Debug.Assert(ServiceInjector.UpdateServices(serviceProvider, instance, mayCache: true));
|
||||
var updateSuccess = ServiceInjector.UpdateServices(serviceProvider, instance, mayCache: true);
|
||||
Debug.Assert(updateSuccess);
|
||||
_ = updateSuccess;
|
||||
|
||||
// TODO: make EmuHawk libraries have a base class with common properties such as this
|
||||
// and inject them here
|
||||
|
|
Loading…
Reference in New Issue