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
Ref patterns for native global variables #1570
Conversation
Leaks are often caused by native global variables holding references to live objects. On Android this is super common due to the IPC mechanism holding on to instances until the stub in the other process is garbage collected. Fixes #1562
SemClipboardManager inner classes are held by native references due to IPC calls | ||
""".trimIndent() | ||
references += nativeGlobalVariableLeak( | ||
"com.samsung.android.content.clipboard.SemClipboardManager$1", description |
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.
Just confirming it is not a typo that new ref has $1
in the end
UPDATE: nevermind, it is below >_>
|
||
data class NativeGlobalVariablePattern(val className: String) : ReferencePattern() { | ||
override fun toString(): String { | ||
return "native global variable referencing $className" |
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.
Nit: here and in other classes I think it would be better for readability to go with the expression body:
override fun toString() = "native global variable referencing $className"
The strings are short enough to fi within line limit and it will result in nice 3-row data classes
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.
Merging, will follow up
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.
Leaks are often caused by native global variables holding references to live objects. On Android this is super common due to the IPC mechanism holding on to instances until the stub in the other process is garbage collected.
Fixes #1562