fix: Use explicit Lazy initializer
Previously DXamlCore and CoreServices used Lazy without explicit initializer parameter. While this worked for debug build, linker removed the "unused" parameterless constructors for these types and reflection then could not find and use them. Using the explicit initializer ensures the constructor is explicitly used and is not linked away.
This commit is contained in:
Родитель
3a23e4d08a
Коммит
e9d02f3f58
|
@ -14,7 +14,7 @@ namespace DirectUI
|
|||
{
|
||||
internal class DXamlCore
|
||||
{
|
||||
private static readonly Lazy<DXamlCore> _current = new Lazy<DXamlCore>();
|
||||
private static readonly Lazy<DXamlCore> _current = new Lazy<DXamlCore>(() => new DXamlCore());
|
||||
|
||||
private BuildTreeService? _buildTreeService;
|
||||
private BudgetManager? _budgetManager;
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Uno.UI.Xaml.Core
|
|||
{
|
||||
internal class CoreServices
|
||||
{
|
||||
private static Lazy<CoreServices> _instance = new Lazy<CoreServices>();
|
||||
private static Lazy<CoreServices> _instance = new Lazy<CoreServices>(() => new CoreServices());
|
||||
|
||||
private VisualTree? _mainVisualTree = null;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче