protected override void Unload() { _searchWindow.Dispose(); _searchIcon.Dispose(); ModuleInstance = null; }
/// <inheritdoc /> protected override void Unload() { // Unload CleanFavorites(); GameService.Overlay.UserLocaleChanged -= ChangeLocalization; printScreenKey.Enabled = false; printScreenKey.Activated -= ScreenshotNotify; printScreenKey = null; modulePanel.Hidden -= ToggleFileSystemWatchers; modulePanel.Shown -= ToggleFileSystemWatchers; modulePanel.Shown -= LoadImages; GameService.Overlay.BlishHudWindow.RemoveTab(moduleTab); moduleTab = null; modulePanel?.Dispose(); moduleCornerIcon?.Dispose(); thumbnailFlowPanel?.Dispose(); // avoiding resource leak for (var i = 0; i < screensPathWatchers.Count; i++) { if (screensPathWatchers[i] == null) { continue; } screensPathWatchers[i].Created -= OnScreenshotCreated; screensPathWatchers[i].Deleted -= OnScreenshotDeleted; screensPathWatchers[i].Renamed -= OnScreenshotRenamed; screensPathWatchers[i].Dispose(); screensPathWatchers[i] = null; } displayedThumbnails.Clear(); displayedThumbnails = null; // All static members must be manually unset ModuleInstance = null; }
/// <summary> /// For a good module experience, your module should clean up ANY and ALL entities /// and controls that were created and added to either the World or SpriteScreen. /// Be sure to remove any tabs added to the Director window, CornerIcons, etc. /// </summary> protected override void Unload() { ModuleInstance = null; GameService.Overlay.BlishHudWindow.RemoveTab(_todoTab); _exampleIcon.Dispose(); _displayedTasks.ForEach(de => de.Dispose()); _displayedTasks.Clear(); }
/// <summary> /// For a good module experience, your module should clean up ANY and ALL entities /// and controls that were created and added to either the World or SpriteScreen. /// Be sure to remove any tabs added to the Director window, CornerIcons, etc. /// </summary> protected override void Unload() { _exampleIcon.Dispose(); _dungeonContextMenuStrip.Dispose(); // Static members are not automatically cleared and will keep a reference to your, // module unless manually unset. ModuleInstance = null; }
protected override void Unload() { ModuleInstance = null; _debugIcon.Dispose(); _debugContextMenuStrip.Dispose(); _toolboxForm.Hide(); _toolboxForm.Dispose(); }
protected override void Unload() { // Unsubscribe from events GameService.Pathing.NewMapLoaded -= _onNewMapLoaded; // Dispose all controls _moduleControls.ForEach(c => c.Dispose()); _moduleControls.Clear(); _mapIcon.Dispose(); _mapIconMenu.Dispose(); _mapIcon = null; _mapIconMenu = null; // Unload and dispose all loaded pathables UnloadAllPathables(); // Release static reference to this module instance ModuleInstance = null; }