protected override void OnClosing(CancelEventArgs e) { Shader.DestroyAll(); ModelManager.Cleanup(); TextureManager.Destroy(); SoundEngine.Destroy(); if (World is WorldClient wc) { WorldLoader.SaveWorld(wc); } base.OnClosing(e); }