protected override void Dispose(bool disposing) { if (_plusTree != null) { try { // Save the system reflection database, if newly created... if (_isSystem) { if (!_isExisted) { // Add some metadata... _plusTree["$DataCount$"] = _count.ToString(); _plusTree["$DataVersion$"] = "2.6.10621.1"; _plusTree.Commit(); } } _plusTree.Shutdown(); _plusTree = null; // For the non-system reflection database, delete after use... if (!_isSystem) { if (!String.IsNullOrEmpty(_treeFileName) && File.Exists(_treeFileName)) { File.Delete(_treeFileName); } if (!String.IsNullOrEmpty(_blockFileName) && File.Exists(_blockFileName)) { File.Delete(_blockFileName); } } } catch { } } }