16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 05:29:18 +02:00

fixed some potential memory leaks and other errors detected by cppcheck

This commit is contained in:
tmj-fstate
2017-01-16 13:26:36 +01:00
parent 15cf3d73a8
commit 68e5dd84e0
18 changed files with 202 additions and 155 deletions

View File

@@ -868,7 +868,7 @@ void TTexturesManager::Free()
{ // usuniêcie wszyskich tekstur (bez usuwania struktury)
// for (Names::iterator iter = _names.begin(); iter != _names.end(); iter++)
if( false == _names.empty() ) {
for( auto texture : _names ) {
for( auto const &texture : _names ) {
glDeleteTextures( 1, &texture.second );
}
}
@@ -876,8 +876,8 @@ void TTexturesManager::Free()
std::string TTexturesManager::GetName(GLuint id)
{ // pobranie nazwy tekstury
for (Names::iterator iter = _names.begin(); iter != _names.end(); iter++)
if (iter->second == id)
return iter->first;
for( auto const &pair : _names ) {
if( pair.second == id ) { return pair.first; }
}
return "";
};