mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 834414 - Fix leaks caused by missing tab change listener unregistrations. r=sriram
This commit is contained in:
parent
6b04dce1cc
commit
57216f4b09
@ -232,6 +232,8 @@ abstract public class BrowserApp extends GeckoApp
|
||||
super.onDestroy();
|
||||
if (mAboutHomeContent != null)
|
||||
mAboutHomeContent.onDestroy();
|
||||
if (mBrowserToolbar != null)
|
||||
mBrowserToolbar.onDestroy();
|
||||
|
||||
unregisterEventListener("CharEncoding:Data");
|
||||
unregisterEventListener("CharEncoding:State");
|
||||
|
@ -1161,10 +1161,8 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
|
||||
}
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
// The action-items views are reused on rotation.
|
||||
// Remove them from their parent, so they can be re-attached to new parent.
|
||||
mActionItemBar.removeAllViews();
|
||||
public void onDestroy() {
|
||||
Tabs.unregisterOnTabsChangedListener(this);
|
||||
}
|
||||
|
||||
public boolean openOptionsMenu() {
|
||||
|
@ -183,6 +183,7 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
if (mFrameRateLayer != null) {
|
||||
mFrameRateLayer.destroy();
|
||||
}
|
||||
Tabs.unregisterOnTabsChangedListener(this);
|
||||
}
|
||||
|
||||
void onSurfaceCreated(EGLConfig config) {
|
||||
|
@ -123,6 +123,9 @@ public class LayerView extends FrameLayout {
|
||||
if (mRenderer != null) {
|
||||
mRenderer.destroy();
|
||||
}
|
||||
if (mTouchEventHandler != null) {
|
||||
mTouchEventHandler.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -141,6 +141,10 @@ public final class TouchEventHandler implements Tabs.OnTabsChangedListener {
|
||||
Tabs.registerOnTabsChangedListener(this);
|
||||
}
|
||||
|
||||
void destroy() {
|
||||
Tabs.unregisterOnTabsChangedListener(this);
|
||||
}
|
||||
|
||||
/* This function MUST be called on the UI thread */
|
||||
public boolean handleEvent(MotionEvent event) {
|
||||
// if we don't have gecko listeners, just dispatch the event
|
||||
|
Loading…
Reference in New Issue
Block a user