From a1466e299bd994d33ca6e59eb33ee999cae9d7bf Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 27 Feb 2020 14:30:49 +0100 Subject: [PATCH] Fix missing recycle call and ensure this mistake will not happen again --- vector/lint.xml | 1 + .../vector/riotx/core/platform/BadgeFloatingActionButton.kt | 2 +- .../home/room/detail/timeline/item/PollResultLineView.kt | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/lint.xml b/vector/lint.xml index 6a9b0634a7..c39f1dcd8d 100644 --- a/vector/lint.xml +++ b/vector/lint.xml @@ -30,6 +30,7 @@ + diff --git a/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt b/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt index ebf04e7097..49931e2b54 100644 --- a/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt +++ b/vector/src/main/java/im/vector/riotx/core/platform/BadgeFloatingActionButton.kt @@ -129,7 +129,7 @@ class BadgeFloatingActionButton @JvmOverloads constructor( attrs?.let { initAttrs(attrs) } } - @SuppressWarnings("ResourceType", "Recycle") + @SuppressWarnings("Recycle") private fun initAttrs(attrs: AttributeSet) { context.obtainStyledAttributes(attrs, R.styleable.BadgeFloatingActionButton).use { counterBackgroundColor = it.getColor(R.styleable.BadgeFloatingActionButton_badgeBackgroundColor, 0) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt index f1e1753b17..a0ad3466f7 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/item/PollResultLineView.kt @@ -73,11 +73,11 @@ class PollResultLineView @JvmOverloads constructor( orientation = HORIZONTAL ButterKnife.bind(this) - val typedArray = context.obtainStyledAttributes(attrs, - R.styleable.PollResultLineView, 0, 0) + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.PollResultLineView, 0, 0) label = typedArray.getString(R.styleable.PollResultLineView_optionName) ?: "" percent = typedArray.getString(R.styleable.PollResultLineView_optionCount) ?: "" optionSelected = typedArray.getBoolean(R.styleable.PollResultLineView_optionSelected, false) isWinner = typedArray.getBoolean(R.styleable.PollResultLineView_optionIsWinner, false) + typedArray.recycle() } }