From 11174b8e75332ae7fc56f55f9adecbff823550b4 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sun, 30 Sep 2018 21:41:46 -0700 Subject: [PATCH] Exit without crashing when app init fails --- README.md | 12 +++++++----- SourceGen/AppForms/ProjectView.cs | 6 ++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 38ab257..ec66623 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ [Features](#key-features) - [Getting Started](#getting-started) - [About the Code](#about-the-code) -6502bench is a code development "workbench" for 6502, 65C02, and 65802/65816 -code. It currently features one tool, the SourceGen disassembler. +[6502bench](https://6502bench.com/) is a code development "workbench" +for 6502, 65C02, and 65802/65816 code. It currently features one tool, +the SourceGen disassembler. You can download the source code and build it yourself, or click the ["Releases" tab](https://github.com/fadden/6502bench/releases) for @@ -79,9 +80,10 @@ Miscellaneous: allow the project to be shared without violating copyrights (subject to local laws). -There are a couple of significant areas where support is currently lacking: -- Poor support for multi-bank 65816 files (IIgs OMF, SNES). -- No support for alternate character sets (e.g. PETSCII). +Some planned features are not yet implemented. Notable among them are +support for multi-bank 65816 files (IIgs OMF, SNES), and alternate +character sets (e.g. PETSCII). Visit the wiki section for the +[current "TO DO" list](https://github.com/fadden/6502bench/wiki/TO-DO-List). ## Getting Started ## diff --git a/SourceGen/AppForms/ProjectView.cs b/SourceGen/AppForms/ProjectView.cs index d4d4347..89aa253 100644 --- a/SourceGen/AppForms/ProjectView.cs +++ b/SourceGen/AppForms/ProjectView.cs @@ -1411,6 +1411,12 @@ namespace SourceGen.AppForms { // App is closing. private void ProjectView_FormClosing(object sender, FormClosingEventArgs e) { Debug.WriteLine("Main app form closing (reason=" + e.CloseReason + ")"); + if (mProjectControl == null) { + // This can be null if something failed during startup, so we're exiting + // the application before the UI is fully up. + return; + } + if (!DoClose()) { e.Cancel = true; return;