You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.
I am a big fan of chat secure, and recently I am writing a static code analysis tool to conduct performance analysis for Android apps. I found several violations of "resource leakage" patterns in chat secure's code. These violations could affect the performance of your app. Here is a representative one.
In info.guardianproject.otr.app.im.app.ChatView$DataAdapter$1, the method handleMessage() invokes "new MediaPlayer();" to create MediaPlayer. However, according to the suggestion of android developer, when done with the MediaPlayer, it is a good practice to call release(), to free the resources. If not released, too many MediaPlayer instances may result in an exception. Unfortunately, this principle is not correctly applied in this method.
So I am curious :) Looking forward to your response. Thanks.
Dear developers,
I am a big fan of chat secure, and recently I am writing a static code analysis tool to conduct performance analysis for Android apps. I found several violations of "resource leakage" patterns in chat secure's code. These violations could affect the performance of your app. Here is a representative one.
In info.guardianproject.otr.app.im.app.ChatView$DataAdapter$1, the method handleMessage() invokes "new MediaPlayer();" to create MediaPlayer. However, according to the suggestion of android developer, when done with the MediaPlayer, it is a good practice to call release(), to free the resources. If not released, too many MediaPlayer instances may result in an exception. Unfortunately, this principle is not correctly applied in this method.
So I am curious :) Looking forward to your response. Thanks.
References:
resource leakage pattern: http://developer.android.com/reference/android/media/MediaPlayer.html
The text was updated successfully, but these errors were encountered: