mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-08 22:48:34 +00:00
Fix conversation item and data source memory leaks.
This commit is contained in:
parent
b27198286d
commit
afbc132faa
@ -49,7 +49,10 @@ class ConversationDataSource extends PositionalDataSource<MessageRecord> {
|
||||
}
|
||||
};
|
||||
|
||||
invalidator.observe(this::invalidate);
|
||||
invalidator.observe(() -> {
|
||||
invalidate();
|
||||
context.getContentResolver().unregisterContentObserver(contentObserver);
|
||||
});
|
||||
|
||||
context.getContentResolver().registerContentObserver(DatabaseContentProviders.Conversation.getUriForThread(threadId), true, contentObserver);
|
||||
}
|
||||
|
@ -377,6 +377,9 @@ public class ConversationItem extends LinearLayout implements BindableConversati
|
||||
if (recipient != null) {
|
||||
recipient.removeForeverObserver(this);
|
||||
}
|
||||
if (conversationRecipient != null) {
|
||||
conversationRecipient.removeForeverObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
public MessageRecord getMessageRecord() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user