Fix memory leak
This commit is contained in:
parent
4e50e6ab55
commit
63a94b874d
2 changed files with 5 additions and 5 deletions
|
@ -84,7 +84,7 @@ public class OsmAndLocationSimulation {
|
||||||
@Override
|
@Override
|
||||||
public boolean processResult(GPXUtilities.GPXFile[] result) {
|
public boolean processResult(GPXUtilities.GPXFile[] result) {
|
||||||
GPXRouteParamsBuilder builder = new GPXRouteParamsBuilder(result[0], app.getSettings());
|
GPXRouteParamsBuilder builder = new GPXRouteParamsBuilder(result[0], app.getSettings());
|
||||||
startAnimationThread(app.getRoutingHelper(), ma, builder.getPoints(), true,
|
startAnimationThread(app, builder.getPoints(), true,
|
||||||
speedup.getProgress() + 1);
|
speedup.getProgress() + 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ public class OsmAndLocationSimulation {
|
||||||
if(currentRoute.isEmpty()) {
|
if(currentRoute.isEmpty()) {
|
||||||
AccessibleToast.makeText(app, R.string.animate_routing_route_not_calculated, Toast.LENGTH_LONG).show();
|
AccessibleToast.makeText(app, R.string.animate_routing_route_not_calculated, Toast.LENGTH_LONG).show();
|
||||||
} else {
|
} else {
|
||||||
startAnimationThread(app.getRoutingHelper(), ma, new ArrayList<Location>(currentRoute), false, 1);
|
startAnimationThread(app, new ArrayList<Location>(currentRoute), false, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,8 +107,7 @@ public class OsmAndLocationSimulation {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startAnimationThread(final RoutingHelper routingHelper,
|
private void startAnimationThread(final OsmandApplication app, final List<Location> directions, final boolean useLocationTime, final float coeff) {
|
||||||
final MapActivity ma, final List<Location> directions, final boolean useLocationTime, final float coeff) {
|
|
||||||
final float time = 1.5f;
|
final float time = 1.5f;
|
||||||
routeAnimation = new Thread() {
|
routeAnimation = new Thread() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -148,7 +147,7 @@ public class OsmAndLocationSimulation {
|
||||||
current.setBearing(prev.bearingTo(current));
|
current.setBearing(prev.bearingTo(current));
|
||||||
}
|
}
|
||||||
final Location toset = current;
|
final Location toset = current;
|
||||||
ma.runOnUiThread(new Runnable() {
|
app.runInUIThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
provider.setLocationFromSimulation(toset);
|
provider.setLocationFromSimulation(toset);
|
||||||
|
|
|
@ -548,6 +548,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
||||||
recordControl = null;
|
recordControl = null;
|
||||||
mapInfoLayer.recreateControls();
|
mapInfoLayer.recreateControls();
|
||||||
}
|
}
|
||||||
|
recordControl = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue