-
Notifications
You must be signed in to change notification settings - Fork 232
TimelineEvent : fix memory leak #1273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## develop #1273 +/- ##
===========================================
- Coverage 57.62% 57.61% -0.01%
===========================================
Files 1087 1087
Lines 28556 28558 +2
Branches 5852 5852
===========================================
Hits 16454 16454
- Misses 9533 9535 +2
Partials 2569 2569
☔ View full report in Codecov by Sentry. |
Those are actually all data classes, can they leak something? They don't have an underlying pointer AFAIK. They're mapped in: public object FfiConverterTypeTimelineItemContentKind : FfiConverterRustBuffer<TimelineItemContentKind>{
override fun read(buf: ByteBuffer): TimelineItemContentKind {
return when(buf.getInt()) {
1 -> TimelineItemContentKind.Message
2 -> TimelineItemContentKind.RedactedMessage
3 -> TimelineItemContentKind.Sticker(
FfiConverterString.read(buf),
FfiConverterTypeImageInfo.read(buf),
FfiConverterString.read(buf),
)
... |
Actually I'm not sure, as they implement Disposable interface, but maybe you're right, I don't know...
|
Actually, I think you're right. The classes themselves are data classes, but some of their properties do have references to Rust pointers, that's why they're closeable. I'll test it tomorrow and approve if everything's fine. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
...n/io/element/android/libraries/matrix/impl/timeline/item/event/TimelineEventContentMapper.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Benoit Marty <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
I spotted this potential memory leak while digging performance issues.