Fixed up some firstOccludingBody bits in [Proto]AntennaRelay.
Fixed up some firstOccludingBody bits in [Proto]AntennaRelay.

--- 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();
+		}
 	}
 }
 

--- a/AntennaRelay.cs
+++ b/AntennaRelay.cs
@@ -80,10 +80,9 @@
 		}
 
 		/// <summary>
-		/// Gets the first occluding body.
-		/// </summary>
-		/// <value>The first occluding body.</value>
-		public CelestialBody firstOccludingBody
+		/// Gets the first <see cref="CelestialBody"/> found to be blocking line of sight.
+		/// </summary>
+		public virtual CelestialBody firstOccludingBody
 		{
 			get;
 			protected set;

--- a/ProtoAntennaRelay.cs
+++ b/ProtoAntennaRelay.cs
@@ -70,16 +70,6 @@
 			}
 		}
 
-
-		public CelestialBody firstOccludingBody
-		{
-			get
-			{
-				return base.firstOccludingBody;
-			}
-		}
-
-
 		/// <summary>
 		/// Gets a value indicating whether this <see cref="AntennaRange.ProtoDataTransmitter"/> has been checked during
 		/// the current relay attempt.