ARMapRenderer: Clean up line renderers when the map is closed.
ARMapRenderer: Clean up line renderers when the map is closed.

--- a/ARMapRenderer.cs
+++ b/ARMapRenderer.cs
@@ -81,6 +81,8 @@
 		{
 			if (!HighLogic.LoadedSceneIsFlight || !MapView.MapIsEnabled)
 			{
+				this.Cleanup();
+
 				return;
 			}
 
@@ -173,8 +175,8 @@
 
 		private void OnDestroy()
 		{
-			this.vesselLineRenderers.Clear();
-			this.vesselLineRenderers = null;
+			this.Cleanup();
+
 			print("ARMapRenderer: Destroyed.");
 		}
 		#endregion
@@ -247,6 +249,17 @@
 			}
 			while (relay != null);
 		}
+
+		public void Cleanup()
+		{
+			foreach (LineRenderer lineRenderer in this.vesselLineRenderers.Values)
+			{
+				lineRenderer.enabled = false;
+				GameObject.Destroy(lineRenderer.gameObject);
+			}
+			this.vesselLineRenderers.Clear();
+			this.vesselFrameCache.Clear();
+		}
 	}
 }