Commit ab1987be authored by Yusuke Iwaki's avatar Yusuke Iwaki

fix crash on switching rooms.

parent 6bc1faf3
...@@ -36,19 +36,19 @@ public class StreamRoomMessageManager implements Registerable { ...@@ -36,19 +36,19 @@ public class StreamRoomMessageManager implements Registerable {
} }
private void registerStreamNotifyMessage(String roomId) { private void registerStreamNotifyMessage(String roomId) {
streamRoomMessage = new StreamRoomMessage(context, realmHelper, ddpClient, roomId);
handler.post(() -> { handler.post(() -> {
streamRoomMessage = new StreamRoomMessage(context, realmHelper, ddpClient, roomId);
streamRoomMessage.register(); streamRoomMessage.register();
}); });
} }
private void unregisterStreamNotifyMessageIfNeeded() { private void unregisterStreamNotifyMessageIfNeeded() {
if (streamRoomMessage != null) { handler.post(() -> {
handler.post(() -> { if (streamRoomMessage != null) {
streamRoomMessage.unregister(); streamRoomMessage.unregister();
streamRoomMessage = null; streamRoomMessage = null;
}); }
} });
} }
@Override public void register() { @Override public void register() {
......
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