protect against start way logic

This commit is contained in:
afischerdev 2025-01-14 11:38:45 +01:00
parent 6f83e2e9c4
commit 068eda48ad
2 changed files with 8 additions and 1 deletions

View File

@ -172,10 +172,15 @@ public final class RoutingContext {
useDynamicDistance = expctxGlobal.getVariableValue("use_dynamic_range", 0f) == 1f; useDynamicDistance = expctxGlobal.getVariableValue("use_dynamic_range", 0f) == 1f;
boolean test = expctxGlobal.getVariableValue("check_start_way", 1f) == 1f; boolean test = expctxGlobal.getVariableValue("check_start_way", 1f) == 1f;
if (!test) expctxGlobal.freeNoWays(); if (!test) freeNoWays();
} }
public void freeNoWays() {
BExpressionContext expctxGlobal = expctxWay;
if (expctxGlobal != null) expctxGlobal.freeNoWays();
}
public List<OsmNodeNamed> poipoints; public List<OsmNodeNamed> poipoints;
public List<OsmNodeNamed> nogopoints = null; public List<OsmNodeNamed> nogopoints = null;

View File

@ -327,6 +327,8 @@ public class RoutingEngine extends Thread {
try { try {
startTime = System.currentTimeMillis(); startTime = System.currentTimeMillis();
routingContext.freeNoWays();
MatchedWaypoint wpt1 = new MatchedWaypoint(); MatchedWaypoint wpt1 = new MatchedWaypoint();
wpt1.waypoint = waypoints.get(0); wpt1.waypoint = waypoints.get(0);
wpt1.name = "wpt_info"; wpt1.name = "wpt_info";