Made the applauncher buttons actually disappear when they should, the VOID-ish way, for better or worse.
Made the applauncher buttons actually disappear when they should, the VOID-ish way, for better or worse.

--- a/VOID_Core.cs
+++ b/VOID_Core.cs
@@ -70,6 +70,7 @@
 		public static void Reset()
 		{
 			_instance.StopGUI();
+			_instance.Dispose();
 			_instance = null;
 			_initialized = false;
 		}
@@ -345,6 +346,14 @@
 				}
 
 				_UseToolbarManager.value = value;
+			}
+		}
+
+		protected virtual ApplicationLauncher.AppScenes appIconVisibleScenes
+		{
+			get
+			{
+				return ApplicationLauncher.AppScenes.FLIGHT;
 			}
 		}
 
@@ -917,7 +926,7 @@
 			{
 				this.AppLauncherButton = ApplicationLauncher.Instance.AddModApplication(
 					this.ToggleMainWindow, this.ToggleMainWindow,
-					HighLogic.LoadedScene.ToAppScenes(),
+					this.appIconVisibleScenes,
 					this.VOIDIconTexture
 				);
 
@@ -1023,27 +1032,6 @@
 			this.configDirty = false;
 		}
 
-		public void onSceneChangeRequested(GameScenes scene)
-		{
-			if (this.AppLauncherButton != null)
-			{
-				if (this is VOID_EditorCore)
-				{
-					if (!HighLogic.LoadedSceneIsEditor)
-					{
-						ApplicationLauncher.Instance.RemoveModApplication(this.AppLauncherButton);
-					}
-				}
-				else
-				{
-					if (!HighLogic.LoadedSceneIsFlight)
-					{
-						ApplicationLauncher.Instance.RemoveModApplication(this.AppLauncherButton);
-					}
-				}
-			}
-		}
-
 		protected VOID_Core()
 		{
 			this._Name = "VOID Core";
@@ -1071,6 +1059,20 @@
 			this.SetIconTexture(this.powerState | this.activeState);
 		}
 
+		public virtual void Dispose()
+		{
+			if (this.AppLauncherButton != null)
+			{
+				ApplicationLauncher.Instance.RemoveModApplication(this.AppLauncherButton);
+				this.AppLauncherButton = null;
+			}
+			if (this.ToolbarButton != null)
+			{
+				this.ToolbarButton.Destroy();
+				this.ToolbarButton = null;
+			}
+		}
+
 		protected enum IconState
 		{
 			PowerOff = 1,

--- a/VOID_EditorCore.cs
+++ b/VOID_EditorCore.cs
@@ -74,6 +74,14 @@
 			}
 		}
 
+		protected override ApplicationLauncher.AppScenes appIconVisibleScenes
+		{
+			get
+			{
+				return ApplicationLauncher.AppScenes.VAB | ApplicationLauncher.AppScenes.SPH;
+			}
+		}
+
 		public VOID_EditorCore() : base()
 		{
 			this._Name = "VOID Editor Core";