Fix crash with particles on resolution change

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7639 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2011-02-06 15:30:43 +00:00
parent c820a7836d
commit 752006e1bb
3 changed files with 10 additions and 3 deletions

View File

@@ -22,6 +22,7 @@
#include "config/user_config.hpp"
#include "graphics/camera.hpp"
#include "graphics/material_manager.hpp"
#include "graphics/particle_kind_manager.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/modaldialog.hpp"
#include "guiengine/scalable_font.hpp"
@@ -339,21 +340,19 @@ void IrrDriver::applyResolutionSettings()
UserConfigParams::m_prev_height) );
m_device->getVideoDriver()->endScene();
// startScreen -> removeTextures();
attachment_manager -> removeTextures();
projectile_manager -> removeTextures();
item_manager -> removeTextures();
kart_properties_manager -> unloadAllKarts();
powerup_manager -> unloadPowerups();
ParticleKindManager::get()->cleanup();
delete input_manager;
GUIEngine::clear();
GUIEngine::cleanUp();
//std::cout << "^^^^^^^^ Closing m_device ^^^^^^^^\n";
m_device->closeDevice();
m_device->clearSystemMessages();
m_device->run();
//std::cout << "^^^^^^^^ Dropping m_device ^^^^^^^^\n";
// Clear the pointer stored in the file manager
file_manager->dropFileSystem();

View File

@@ -42,6 +42,13 @@ ParticleKindManager::ParticleKindManager()
// ----------------------------------------------------------------------------
ParticleKindManager::~ParticleKindManager()
{
cleanup();
}
// ----------------------------------------------------------------------------
void ParticleKindManager::cleanup()
{
cleanUpTrackSpecificGfx();

View File

@@ -47,6 +47,7 @@ public:
ParticleKind* getParticles(const std::string &name);
void cleanUpTrackSpecificGfx();
void cleanup();
static ParticleKindManager* get();
};