public override void UnloadContent() { SDL.SDL_GetWindowBordersSize(Window.Handle, out int top, out int left, out int bottom, out int right); Settings.GlobalSettings.WindowPosition = new Point(Math.Max(0, Window.ClientBounds.X - left), Math.Max(0, Window.ClientBounds.Y - top)); Settings.GlobalSettings.Save(); Plugin.OnClosing(); _hues_sampler[0]?.Dispose(); _hues_sampler[0] = null; _hues_sampler[1]?.Dispose(); _hues_sampler[1] = null; _scene?.Dispose(); AuraManager.Dispose(); UIManager.Dispose(); Texture2DCache.Dispose(); //NOTE: We force the sockets to disconnect in case they haven't already been disposed //This is good practice since the Client can be quit while the socket is still active if (NetClient.LoginSocket.IsDisposed == false) { NetClient.LoginSocket.Disconnect(); } if (NetClient.Socket.IsDisposed == false) { NetClient.Socket.Disconnect(); } base.UnloadContent(); }
public override void UnloadContent() { SDL.SDL_GetWindowBordersSize(Window.Handle, out int top, out int left, out int bottom, out int right); Settings.GlobalSettings.WindowPosition = new Point(Math.Max(0, Window.ClientBounds.X - left), Math.Max(0, Window.ClientBounds.Y - top)); _scene?.Unload(); Settings.GlobalSettings.Save(); Plugin.OnClosing(); ArtLoader.Instance.Dispose(); GumpsLoader.Instance.Dispose(); TexmapsLoader.Instance.Dispose(); AnimationsLoader.Instance.Dispose(); LightsLoader.Instance.Dispose(); TileDataLoader.Instance.Dispose(); AnimDataLoader.Instance.Dispose(); ClilocLoader.Instance.Dispose(); FontsLoader.Instance.Dispose(); HuesLoader.Instance.Dispose(); MapLoader.Instance.Dispose(); MultiLoader.Instance.Dispose(); MultiMapLoader.Instance.Dispose(); ProfessionLoader.Instance.Dispose(); SkillsLoader.Instance.Dispose(); SoundsLoader.Instance.Dispose(); SpeechesLoader.Instance.Dispose(); Verdata.File?.Dispose(); World.Map?.Destroy(); //NOTE: My dispose related changes, see if they're still necessary _hues_sampler[0]?.Dispose(); _hues_sampler[0] = null; _hues_sampler[1]?.Dispose(); _hues_sampler[1] = null; _scene?.Dispose(); AuraManager.Dispose(); UIManager.Dispose(); Texture2DCache.Dispose(); RenderedText.Dispose(); //NOTE: We force the sockets to disconnect in case they haven't already been disposed //This is good practice since the Client can be quit while the socket is still active if (NetClient.LoginSocket.IsDisposed == false) { NetClient.LoginSocket.Disconnect(); } if (NetClient.Socket.IsDisposed == false) { NetClient.Socket.Disconnect(); } base.UnloadContent(); }
public override void UnloadContent() { SDL.SDL_GetWindowBordersSize(Window.Handle, out int top, out int left, out int bottom, out int right); Settings.GlobalSettings.WindowPosition = new Point(Math.Max(0, Window.ClientBounds.X - left), Math.Max(0, Window.ClientBounds.Y - top)); Settings.GlobalSettings.Save(); Plugin.OnClosing(); _hues_sampler[0]?.Dispose(); _hues_sampler[0] = null; _hues_sampler[1]?.Dispose(); _hues_sampler[1] = null; _scene?.Dispose(); AuraManager.Dispose(); UIManager.Dispose(); Texture2DCache.Dispose(); base.UnloadContent(); }