mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Merge branch '714-asynchronous-context-leaks' into 'master'
Fixed asynchronous Activity leaks in Fragments If a Fragment has been detached its `getActivity()` method will return null, providing numerous crash possibilities within the app. My approach to fixing this is to make Fragments use their own `runOnUiThreadUnlessDestroyed` method, which also checks if the Fragment has been detached before running the Runnable Closes #714 See merge request !387
This commit is contained in:
@@ -126,7 +126,7 @@ public class GroupListFragment extends BaseFragment implements
|
||||
@Override
|
||||
public void onGroupRemoveClick(GroupItem item) {
|
||||
controller.removeGroup(item.getId(),
|
||||
new UiResultExceptionHandler<Void, DbException>(listener) {
|
||||
new UiResultExceptionHandler<Void, DbException>(this) {
|
||||
@Override
|
||||
public void onResultUi(Void result) {
|
||||
// handled by GroupRemovedEvent and onGroupRemoved()
|
||||
@@ -173,7 +173,7 @@ public class GroupListFragment extends BaseFragment implements
|
||||
final int revision = adapter.getRevision();
|
||||
controller.loadGroups(
|
||||
new UiResultExceptionHandler<Collection<GroupItem>, DbException>(
|
||||
listener) {
|
||||
this) {
|
||||
@Override
|
||||
public void onResultUi(Collection<GroupItem> groups) {
|
||||
if (revision == adapter.getRevision()) {
|
||||
|
||||
Reference in New Issue
Block a user