Sound pointers worden gedelete

This commit is contained in:
Aaldert
2016-06-21 14:45:41 +02:00
parent 6096e53d94
commit eadfea9d63
6 changed files with 16 additions and 9 deletions
+4 -5
View File
@@ -8,8 +8,7 @@
#include <algorithm>
#include "WorldHandler.h"
World::World(const std::string &fileName):
music_id(-1)
World::World(const std::string &fileName)
{
nextworld = false;
@@ -183,8 +182,8 @@ World::World(const std::string &fileName):
if (!v["world"]["music"].isNull())
{
music_id = CrystalPoint::GetSoundSystem().LoadSound(v["world"]["music"].asString().c_str(), true);
music = CrystalPoint::GetSoundSystem().GetSound(music_id);
sound_id = CrystalPoint::GetSoundSystem().LoadSound(v["world"]["music"].asString().c_str(), true);
music = CrystalPoint::GetSoundSystem().GetSound(sound_id);
}
if (!v["portal"].isNull())
@@ -218,7 +217,7 @@ World::~World()
{
delete heightmap;
music->Stop();
delete music;
CrystalPoint::GetSoundSystem().UnloadSound(sound_id);
delete skybox;
delete portal;
}