diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-06-06 00:24:46 +0300 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-06-05 23:48:45 +0200 |
commit | f6583ac4b10f9e703fe1d44a1847444d34e09ab6 (patch) | |
tree | 9d801ddbf15a2825c64b4974e3d12b765e8c9465 /src/map.cpp | |
parent | 18c1842f1e566390b4d93c94628db49c4895c881 (diff) | |
download | mana-f6583ac4b10f9e703fe1d44a1847444d34e09ab6.tar.gz mana-f6583ac4b10f9e703fe1d44a1847444d34e09ab6.tar.bz2 mana-f6583ac4b10f9e703fe1d44a1847444d34e09ab6.tar.xz mana-f6583ac4b10f9e703fe1d44a1847444d34e09ab6.zip |
Fix memory leak in minimap
Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp index 7ee18450..52459415 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -580,16 +580,13 @@ const std::string Map::getName() const return getProperty("mapname"); } -const std::string *Map::getFilename() const +const std::string Map::getFilename() const { std::string fileName = getProperty("_filename"); int lastSlash = fileName.rfind("/") + 1; int lastDot = fileName.rfind("."); - std::string *sub = new std::string( - fileName.substr(lastSlash, lastDot - lastSlash)); - - return sub; + return fileName.substr(lastSlash, lastDot - lastSlash); } Position Map::checkNodeOffsets(int radius, unsigned char walkMask, |