mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 21:29:18 +02:00
fixed some potential memory leaks and other errors detected by cppcheck
This commit is contained in:
@@ -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 "";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user