Skip to content

Commit

Permalink
fix memory leak when restarting the app with feature layer enabled an…
Browse files Browse the repository at this point in the history
…d max features exceeded (causing max features warning)
  • Loading branch information
jclark118 committed Oct 19, 2023
1 parent 1fcf1c3 commit 40af0ba
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions mapcache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ android {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
defaultConfig {
applicationId "mil.nga.mapcache"
resValue "string", "applicationId", applicationId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,11 @@ private enum EditType {
*/
AlertDialog disclaimerDialog;

/**
* Max features warning popup dialog
*/
AlertDialog maxFeaturesDialog;

/**
* Model that contains various states involving the map.
*/
Expand Down Expand Up @@ -1658,6 +1663,9 @@ public void onStop() {
if(disclaimerDialog != null) {
disclaimerDialog.dismiss();
}
if(maxFeaturesDialog != null){
maxFeaturesDialog.dismiss();
}
super.onStop();
}

Expand Down Expand Up @@ -1703,7 +1711,8 @@ private void showMaxFeaturesExceeded() {
}
d.cancel();
});
dialog.show();
maxFeaturesDialog = dialog.create();
maxFeaturesDialog.show();
}
}
}
Expand Down

0 comments on commit 40af0ba

Please sign in to comment.