[Marble-commits] KDE/kdeedu/marble/src/lib
Torsten Rahn
tackat at kde.org
Mon Nov 16 01:21:25 CET 2009
SVN commit 1049860 by rahn:
Author: Bernhard Beschow <bbeschow at cs.tu-berlin.de>
- check, whether loading a tile from disk was actually successfull
- fix memory leak
M +5 -8 TextureTile.cpp
--- trunk/KDE/kdeedu/marble/src/lib/TextureTile.cpp #1049859:1049860
@@ -253,12 +253,10 @@
bool download = false;
bool currentTileAvailable = false;
- TextureTile *currentTile = 0;
- TileId currentTileId( currentLevel, (int)(currentX), (int)(currentY) );
-
// Check whether the current tile id is available in the CACHE:
if ( tileCache ) {
- currentTile = tileCache->take( currentTileId );
+ TileId currentTileId( currentLevel, (int)(currentX), (int)(currentY) );
+ TextureTile *currentTile = tileCache->take( currentTileId );
if ( currentTile ) {
// the tile was in the cache, but is it up to date?
@@ -266,16 +264,14 @@
if ( lastModified.secsTo( now ) < textureLayer->expire()) {
temptile = currentTile->rawtile();
currentTileAvailable = true;
- } else {
- delete currentTile;
- currentTile = 0;
}
+ delete currentTile;
}
}
// If the current tile id is not in the cache or if it was
// in the cache but has expired load from DISK:
- if ( !currentTile ) {
+ if ( temptile.isNull() ) {
QString relfilename =
TileLoaderHelper::relativeTileFileName( textureLayer, currentLevel,
(int)(currentX), (int)(currentY) );
@@ -309,6 +305,7 @@
// << "format:" << temptile.format()
// << "bytesPerLine:" << temptile.bytesPerLine()
// << "numBytes:" << temptile.numBytes() ;
+ download = temptile.isNull();
currentTileAvailable = true;
}
}
More information about the Marble-commits
mailing list