mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-26 14:27:34 +00:00
Fix conversation item and data source memory leaks.
This commit is contained in:

committed by
Greyson Parrelli

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() {
|
||||
|
Reference in New Issue
Block a user