From 63a94b874ddf6b9664b32052276d8e6a46680818 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 10 Sep 2015 01:47:54 +0200 Subject: [PATCH] Fix memory leak --- OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java | 9 ++++----- .../osmand/plus/audionotes/AudioVideoNotesPlugin.java | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java index e202bfb68d..cc8c2ab419 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java @@ -84,7 +84,7 @@ public class OsmAndLocationSimulation { @Override public boolean processResult(GPXUtilities.GPXFile[] result) { GPXRouteParamsBuilder builder = new GPXRouteParamsBuilder(result[0], app.getSettings()); - startAnimationThread(app.getRoutingHelper(), ma, builder.getPoints(), true, + startAnimationThread(app, builder.getPoints(), true, speedup.getProgress() + 1); return true; } @@ -94,7 +94,7 @@ public class OsmAndLocationSimulation { if(currentRoute.isEmpty()) { AccessibleToast.makeText(app, R.string.animate_routing_route_not_calculated, Toast.LENGTH_LONG).show(); } else { - startAnimationThread(app.getRoutingHelper(), ma, new ArrayList(currentRoute), false, 1); + startAnimationThread(app, new ArrayList(currentRoute), false, 1); } } @@ -107,8 +107,7 @@ public class OsmAndLocationSimulation { } } - private void startAnimationThread(final RoutingHelper routingHelper, - final MapActivity ma, final List directions, final boolean useLocationTime, final float coeff) { + private void startAnimationThread(final OsmandApplication app, final List directions, final boolean useLocationTime, final float coeff) { final float time = 1.5f; routeAnimation = new Thread() { @Override @@ -148,7 +147,7 @@ public class OsmAndLocationSimulation { current.setBearing(prev.bearingTo(current)); } final Location toset = current; - ma.runOnUiThread(new Runnable() { + app.runInUIThread(new Runnable() { @Override public void run() { provider.setLocationFromSimulation(toset); diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index d22e27395e..e56297ddaf 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -548,6 +548,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { recordControl = null; mapInfoLayer.recreateControls(); } + recordControl = null; } }