release locked tiles for labeling directly

This commit is contained in:
Hannes Janetzek 2013-02-07 10:33:11 +01:00
parent f5532059ec
commit c53805aded
2 changed files with 11 additions and 1 deletions

View File

@ -542,6 +542,14 @@ public class GLRenderer implements GLSurfaceView.Renderer {
return td;
}
public static void releaseTiles(TileSet td) {
for (int i = 0; i < td.cnt; i++) {
td.tiles[i].unlock();
td.tiles[i] = null;
}
td.cnt = 0;
}
@Override
public void onSurfaceChanged(GL10 glUnused, int width, int height) {
Log.d(TAG, "SurfaceChanged:" + mNewSurface + " " + width + " " + height);

View File

@ -48,7 +48,7 @@ public class TextOverlayExp extends BasicOverlay {
// private final static String TAG = TextOverlayExp.class.getName();
private TileSet mTileSet;
private LabelThread mThread;
private final LabelThread mThread;
private MapPosition mTmpPos;
@ -419,6 +419,8 @@ public class TextOverlayExp extends BasicOverlay {
//TextItem.printPool();
//Log.d(TAG, "new labels: " + count);
GLRenderer.releaseTiles(mTileSet);
// pass new labels for rendering
synchronized (this) {
mNextLayer = tl;