]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/sound_openal.cpp
src/environment.cpp: Fix NULL pointer dereference
[dragonfireclient.git] / src / sound_openal.cpp
index 0cfbc279829a95978c94979d3339eb4be67332d8..cb4c7b5818dde9e90746f7843b622240ef1189dd 100644 (file)
@@ -37,10 +37,10 @@ with this program; ifnot, write to the Free Software Foundation, Inc.,
        #include <AL/alext.h>
 #endif
 #include <vorbis/vorbisfile.h>
+#include <assert.h>
 #include "log.h"
 #include "filesys.h"
 #include "util/numeric.h" // myrand()
-#include "debug.h" // assert()
 #include "porting.h"
 #include <map>
 #include <vector>
@@ -391,7 +391,7 @@ class OpenALSoundManager: public ISoundManager
        }
 
        /* If buffer does not exist, consult the fetcher */
-       SoundBuffer* getFetchBuffer(const std::string name)
+       SoundBuffer* getFetchBuffer(const std::string &name)
        {
                SoundBuffer *buf = getBuffer(name);
                if(buf)
@@ -434,7 +434,7 @@ class OpenALSoundManager: public ISoundManager
                                }
                        }
                }
-               if(del_list.size() != 0)
+               if(!del_list.empty())
                        verbosestream<<"OpenALSoundManager::maintain(): deleting "
                                        <<del_list.size()<<" playing sounds"<<std::endl;
                for(std::set<int>::iterator i = del_list.begin();