Be more conservative with handlers and references

Expiring message timers could end up leaking references and
executing work even after their conversation item was no longer
visible

Maybe fixes #6898

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-09-09 23:46:48 -07:00
parent 6a10c69df8
commit f3d943270c
9 changed files with 67 additions and 77 deletions

View File

@@ -379,6 +379,10 @@ public class Util {
else handler.post(runnable);
}
public static void runOnMainDelayed(final @NonNull Runnable runnable, long delayMillis) {
handler.postDelayed(runnable, delayMillis);
}
public static void runOnMainSync(final @NonNull Runnable runnable) {
if (isMainThread()) {
runnable.run();