Commit 0c9f9814 authored by Robert Hitt's avatar Robert Hitt
Browse files

Removed a potential source of memory leaks

parent d3edfb31
......@@ -48,6 +48,12 @@ public class DetailActivity extends AppCompatActivity implements FacilityView{
fillTextViews();
}
@Override
protected void onDestroy() {
mPresenter.detachView();
super.onDestroy();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_detail, menu);
......
......@@ -25,6 +25,11 @@ public class FacilityPresenter {
mFacility = facility;
}
public void detachView() {
mFacilityView = null;
mFacility = null;
}
// Asynchronously updates the Realm object's favorite status
// and updates the favorite status in SharedPreferences
public void toggleFavorite() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment