mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1298161 - c. Properly remove pref handler in NativePanZoomController; r=rbarker
Properly remove pref handler on destroy to prevent leaking BrowserApp.
This commit is contained in:
parent
9fe8d04e65
commit
e6e2011d34
@ -29,7 +29,7 @@ class NativePanZoomController extends JNIObject implements PanZoomController {
|
||||
private Overscroll mOverscroll;
|
||||
boolean mNegateWheelScroll;
|
||||
private float mPointerScrollFactor;
|
||||
private final PrefsHelper.PrefHandler mPrefsObserver;
|
||||
private PrefsHelper.PrefHandler mPrefsObserver;
|
||||
private long mLastDownTime;
|
||||
private static final float MAX_SCROLL = 0.075f * GeckoAppShell.getDpi();
|
||||
|
||||
@ -197,6 +197,10 @@ class NativePanZoomController extends JNIObject implements PanZoomController {
|
||||
|
||||
@Override @WrapForJNI(calledFrom = "ui") // PanZoomController
|
||||
public void destroy() {
|
||||
if (mPrefsObserver != null) {
|
||||
PrefsHelper.removeObserver(mPrefsObserver);
|
||||
mPrefsObserver = null;
|
||||
}
|
||||
if (mDestroyed || !mTarget.isGeckoReady()) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user