Make AuthorManager volatile as it is accessed from DbThread

This commit is contained in:
Torsten Grote
2020-11-26 11:32:16 -03:00
parent fce1247aa6
commit 9bd7214d1d
2 changed files with 6 additions and 2 deletions

View File

@@ -251,8 +251,10 @@ public class BriarService extends Service {
Glide.get(getApplicationContext()).clearMemory();
} else if (level == TRIM_MEMORY_RUNNING_LOW) {
LOG.info("Trim memory: running low");
// TODO investigate if we can clear Glide cache here as well
} else if (level == TRIM_MEMORY_RUNNING_CRITICAL) {
LOG.warning("Trim memory: running critically low");
// TODO investigate if we can clear Glide cache here as well
// If we're not in the foreground, clear the UI to save memory
if (app.isRunningInBackground()) hideUi();
} else if (LOG.isLoggable(INFO)) {

View File

@@ -44,10 +44,12 @@ import static org.briarproject.bramble.util.LogUtils.logException;
abstract class SharingStatusActivity extends BriarActivity
implements EventListener {
// objects accessed from background thread need to be volatile
@Inject
AuthorManager authorManager;
volatile AuthorManager authorManager;
@Inject
ConnectionRegistry connectionRegistry;
volatile ConnectionRegistry connectionRegistry;
@Inject
EventBus eventBus;