/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing"> true if managed resources should be disposed; otherwise, false. </param> protected override void Dispose(bool disposing) { EidssMapSerializer.Instance.LayerDeserializationExceptionEvent -= Instance_LayerDeserializationExceptionEvent; if (m_ZlyrSelector != null) { m_ZlyrSelector.Dispose(); m_ZlyrSelector = null; } if (m_MapSelector != null) { m_MapSelector.Dispose(); m_MapSelector = null; } if (m_mapImage != null && !m_mapImage.IsDisposed) { m_mapImage.Dispose(); //Crash where! m_mapImage = null; } if (m_MapContent != null) { m_MapContent.Map = null; } base.Dispose(disposing); }