Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c74b5c17 authored by qqzhou's avatar qqzhou Committed by Gerrit - the friendly Code Review server
Browse files

Dialer: fix memory leak in DialpadFragment

By MAT tool, we find there exists several PopupMenu
objects after repeating operation "dial 10086 -> hangup"
several times. It's not right, there should exist only
one object of PopupMenu for DialpadFragment. This PopupMenu
object occupies 40 byte but indeed causes memory leak.
The root cause is that we will call onResume() after hangup
every time, onResume will new PopupMenu every time and set its
mDragListener to overflow image button's mOnAttachStateChangeListeners,
this listener references PopupMenu object and causes PopupMenu can not
be released by GC.

We create PopupMenu in onCreate instead of onResume to avoid
this leak.

Change-Id: Id787bc5e23f9d5f86a9fa03536e9ae901e12cb13
parent 1f01e495
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment