Fixed the issue that crash when close.
This commit is contained in:
@@ -13,10 +13,10 @@
|
|||||||
<langversion>preview</langversion>
|
<langversion>preview</langversion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.2" />
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.5" />
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7463" />
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7705" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260101001" />
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260317003" />
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.251219" />
|
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.251219" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,6 @@ public class NotificationService : INotificationService
|
|||||||
|
|
||||||
internal void ClearReference()
|
internal void ClearReference()
|
||||||
{
|
{
|
||||||
if (_infoBar != null)
|
|
||||||
{
|
|
||||||
_infoBar.IsOpen = false;
|
|
||||||
}
|
|
||||||
_infoBar = null;
|
_infoBar = null;
|
||||||
_notificationQueue = null;
|
_notificationQueue = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public static class TypeCache
|
|||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Init()
|
internal static void Initialize()
|
||||||
{
|
{
|
||||||
// Intentionally left blank.
|
// Intentionally left blank.
|
||||||
// This method exists to force the static constructor to run.
|
// This method exists to force the static constructor to run.
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using Ghost.Editor.Core.Utilities;
|
using Ghost.Editor.Core.Utilities;
|
||||||
using Ghost.Editor.Models;
|
using Ghost.Editor.Models;
|
||||||
using Ghost.Engine;
|
|
||||||
using Misaki.HighPerformance.LowLevel.Buffer;
|
using Misaki.HighPerformance.LowLevel.Buffer;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ internal static class ActivationHandler
|
|||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task HandleAsync(LaunchArguments args)
|
public static ValueTask HandleAsync(LaunchArguments args)
|
||||||
{
|
{
|
||||||
var opts = new AllocationManagerInitOpts
|
var opts = new AllocationManagerInitOpts
|
||||||
{
|
{
|
||||||
@@ -62,16 +61,18 @@ internal static class ActivationHandler
|
|||||||
};
|
};
|
||||||
|
|
||||||
AllocationManager.Initialize(opts);
|
AllocationManager.Initialize(opts);
|
||||||
|
TypeCache.Initialize();
|
||||||
await Task.Run(() =>
|
|
||||||
{
|
|
||||||
TypeCache.Init();
|
|
||||||
App.GetService<EngineCore>();
|
|
||||||
});
|
|
||||||
|
|
||||||
// await ((Core.AssetHandle.AssetService)App.GetService<IAssetService>()).Init();
|
// await ((Core.AssetHandle.AssetService)App.GetService<IAssetService>()).Init();
|
||||||
|
|
||||||
// TODO: Init other subsystems here.
|
// TODO: Init other subsystems here.
|
||||||
// await Task.Delay(10000); // Wait 10 seconds to simulate work.
|
// await Task.Delay(10000); // Wait 10 seconds to simulate work.
|
||||||
|
|
||||||
|
return ValueTask.CompletedTask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Shutdown()
|
||||||
|
{
|
||||||
|
AllocationManager.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,12 +144,17 @@ public partial class App : Application
|
|||||||
Host.StopAsync().GetAwaiter().GetResult();
|
Host.StopAsync().GetAwaiter().GetResult();
|
||||||
Host.Dispose();
|
Host.Dispose();
|
||||||
|
|
||||||
EditorApplication.Shutdown();
|
//EditorApplication.Shutdown();
|
||||||
|
ActivationHandler.Shutdown();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debugger.BreakForUserUnhandledException(ex);
|
Debugger.BreakForUserUnhandledException(ex);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
//Environment.Exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
private void App_UnhandledException(object sender, Microsoft.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="View\Controls\Hierarchy.xaml" />
|
<None Remove="View\Controls\Hierarchy.xaml" />
|
||||||
|
<None Remove="View\Windows\BlankWindow1.xaml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||||
@@ -38,10 +39,10 @@
|
|||||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.251219" />
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.251219" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.251219" />
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.251219" />
|
||||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.TabbedCommandBar" Version="8.2.251219" />
|
<PackageReference Include="CommunityToolkit.WinUI.Controls.TabbedCommandBar" Version="8.2.251219" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.2" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.5" />
|
||||||
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
|
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7463" />
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.7705" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260101001" />
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260317003" />
|
||||||
<PackageReference Include="WinUIEx" Version="2.9.0" />
|
<PackageReference Include="WinUIEx" Version="2.9.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -141,6 +142,9 @@
|
|||||||
<None Update="Assets\icon.ico">
|
<None Update="Assets\icon.ico">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<Page Update="View\Windows\BlankWindow1.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Update="View\Controls\Hierarchy.xaml">
|
<Page Update="View\Controls\Hierarchy.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -8,12 +8,13 @@
|
|||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="local:DockGroup">
|
<ControlTemplate TargetType="local:DockGroup">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TabView x:Name="PART_TabView"
|
<TabView
|
||||||
IsAddTabButtonVisible="False"
|
x:Name="PART_TabView"
|
||||||
CanDragTabs="True"
|
VerticalAlignment="Stretch"
|
||||||
CanReorderTabs="False"
|
AllowDrop="True"
|
||||||
AllowDrop="True">
|
CanDragTabs="True"
|
||||||
</TabView>
|
CanReorderTabs="False"
|
||||||
|
IsAddTabButtonVisible="False" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
|
|||||||
@@ -144,6 +144,8 @@
|
|||||||
DoubleTapped="PART_FilesView_DoubleTapped"
|
DoubleTapped="PART_FilesView_DoubleTapped"
|
||||||
IsDoubleTapEnabled="True"
|
IsDoubleTapEnabled="True"
|
||||||
ItemsSource="{x:Bind ViewModel.Files, Mode=OneWay}"
|
ItemsSource="{x:Bind ViewModel.Files, Mode=OneWay}"
|
||||||
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||||
|
ScrollViewer.HorizontalScrollMode="Disabled"
|
||||||
SelectionChanged="PART_FilesView_SelectionChanged"
|
SelectionChanged="PART_FilesView_SelectionChanged"
|
||||||
SelectionMode="Single">
|
SelectionMode="Single">
|
||||||
<ItemsView.ItemTemplate>
|
<ItemsView.ItemTemplate>
|
||||||
|
|||||||
17
src/Editor/Ghost.Editor/View/Windows/BlankWindow1.xaml
Normal file
17
src/Editor/Ghost.Editor/View/Windows/BlankWindow1.xaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Window
|
||||||
|
x:Class="Ghost.Editor.View.Windows.BlankWindow1"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="using:Ghost.Editor.View.Windows"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
Title="BlankWindow1"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Window.SystemBackdrop>
|
||||||
|
<MicaBackdrop />
|
||||||
|
</Window.SystemBackdrop>
|
||||||
|
|
||||||
|
<Grid />
|
||||||
|
</Window>
|
||||||
29
src/Editor/Ghost.Editor/View/Windows/BlankWindow1.xaml.cs
Normal file
29
src/Editor/Ghost.Editor/View/Windows/BlankWindow1.xaml.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace Ghost.Editor.View.Windows;
|
||||||
|
/// <summary>
|
||||||
|
/// An empty window that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class BlankWindow1 : Window
|
||||||
|
{
|
||||||
|
public BlankWindow1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -64,8 +64,12 @@
|
|||||||
</ctc:TabbedCommandBar>
|
</ctc:TabbedCommandBar>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<Grid xmlns:dock="using:Ghost.Editor.View.Controls.Docking" Grid.Row="2">
|
||||||
|
<dock:DockingLayout x:Name="MainDockingLayout" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<!-- Editor -->
|
<!-- Editor -->
|
||||||
<Grid Grid.Row="2">
|
<!--<Grid Grid.Row="2">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -134,7 +138,7 @@
|
|||||||
</TabViewItem>
|
</TabViewItem>
|
||||||
</ghost:NavigationTabView.TabItems>
|
</ghost:NavigationTabView.TabItems>
|
||||||
</ghost:NavigationTabView>
|
</ghost:NavigationTabView>
|
||||||
</Grid>
|
</Grid>-->
|
||||||
|
|
||||||
<!-- Status Bar -->
|
<!-- Status Bar -->
|
||||||
<Grid
|
<Grid
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public sealed partial class EngineCore : IDisposable
|
|||||||
public JobScheduler JobScheduler => _jobScheduler;
|
public JobScheduler JobScheduler => _jobScheduler;
|
||||||
public RenderSystem RenderSystem => _renderSystem;
|
public RenderSystem RenderSystem => _renderSystem;
|
||||||
|
|
||||||
internal EngineCore()
|
public EngineCore()
|
||||||
{
|
{
|
||||||
_jobScheduler = new JobScheduler(Environment.ProcessorCount - 2); // We -2 here, one for main thread, one for render thread
|
_jobScheduler = new JobScheduler(Environment.ProcessorCount - 2); // We -2 here, one for main thread, one for render thread
|
||||||
|
|
||||||
@@ -35,6 +35,7 @@ public sealed partial class EngineCore : IDisposable
|
|||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
_renderSystem.Dispose();
|
||||||
_jobScheduler.Dispose();
|
_jobScheduler.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user