Merge pull request #998 from peppy/fix-startup-crash

Fix crash on startup for release builds
This commit is contained in:
Thomas Müller 2017-07-08 11:58:45 +03:00 committed by GitHub
commit ec1da92639
2 changed files with 9 additions and 10 deletions

View File

@ -11,6 +11,7 @@
using System.Drawing;
using System.IO;
using System.Threading.Tasks;
using osu.Framework.Graphics.Containers;
using osu.Game.Screens.Menu;
namespace osu.Desktop
@ -22,18 +23,22 @@ internal class OsuGameDesktop : OsuGame
public OsuGameDesktop(string[] args = null)
: base(args)
{
versionManager = new VersionManager { Depth = int.MinValue };
versionManager = new VersionManager
{
Depth = int.MinValue,
State = Visibility.Hidden
};
}
protected override void LoadComplete()
{
base.LoadComplete();
LoadComponentAsync(versionManager);
LoadComponentAsync(versionManager, Add);
ScreenChanged += s =>
{
if (!versionManager.IsAlive && s is Intro)
Add(versionManager);
if (!versionManager.IsPresent && s is Intro)
versionManager.State = Visibility.Visible;
};
}

View File

@ -93,12 +93,6 @@ private void load(NotificationManager notification, OsuColour colours, TextureSt
checkForUpdateAsync();
}
protected override void LoadComplete()
{
base.LoadComplete();
State = Visibility.Visible;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);