Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OffRoute engine cleared before service shutdown #1167

Merged
merged 1 commit into from
Aug 3, 2018

Conversation

danesfeder
Copy link
Contributor

Actually Fixes #1139

We are setting the camera engine to null here because it holds onto MapboxMap and is then given to MapboxNavigation.

For the turn-by-turn UI, MapboxNavigation survives rotation, so we need to set it to null so it doesn't leak.

@danesfeder danesfeder added bug Defect to be fixed. navigation-core labels Jul 31, 2018
@danesfeder danesfeder added this to the 0.17.0 milestone Jul 31, 2018
@danesfeder danesfeder self-assigned this Jul 31, 2018
@@ -97,6 +97,7 @@ public void onDestroy(boolean isChangingConfigurations) {
deactivateInstructionPlayer();
endNavigation();
}
navigation.setCameraEngine(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently doing nothing 👀

public void setCameraEngine(@NonNull Camera cameraEngine) {
  navigationEngineFactory.updateCameraEngine(cameraEngine);
}

👇

void updateCameraEngine(Camera cameraEngine) {
  if (cameraEngine == null) {
    return;
  }
  this.cameraEngine = cameraEngine;
}

Also, note

Passing 'null' argument to parameter annotated as @NotNull

Copy link
Contributor

@Guardiola31337 Guardiola31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After rebased @danesfeder this is good to go 🚀

@danesfeder danesfeder merged commit e54531c into master Aug 3, 2018
@danesfeder danesfeder deleted the dan-off-route-clear-engine branch August 3, 2018 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Defect to be fixed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants