public void CloseLib() { if (lib != null) { this.mainForm.CloseMaps(); lib.Clear(); lib = null; mainForm.InitLibControls(); } layer = null; this.connection = null; }