mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 834414 - Destroy the SiteIdentityPopup when the activity is destroyed to prevent leaking the activity. r=margaret
This commit is contained in:
parent
9754ce36f2
commit
c788ffe1ee
@ -2280,6 +2280,7 @@ abstract public class GeckoApp
|
||||
mPromptService.destroy();
|
||||
if (mTextSelection != null)
|
||||
mTextSelection.destroy();
|
||||
SiteIdentityPopup.clearInstance();
|
||||
|
||||
Tabs.getInstance().detachFromActivity(this);
|
||||
|
||||
|
@ -29,6 +29,8 @@ public class SiteIdentityPopup extends PopupWindow {
|
||||
public static final String VERIFIED = "verified";
|
||||
public static final String IDENTIFIED = "identified";
|
||||
|
||||
private static SiteIdentityPopup sInstance;
|
||||
|
||||
private Resources mResources;
|
||||
private boolean mInflated;
|
||||
|
||||
@ -48,12 +50,15 @@ public class SiteIdentityPopup extends PopupWindow {
|
||||
mInflated = false;
|
||||
}
|
||||
|
||||
private static class InstanceHolder {
|
||||
private static final SiteIdentityPopup INSTANCE = new SiteIdentityPopup();
|
||||
public static synchronized SiteIdentityPopup getInstance() {
|
||||
if (sInstance == null) {
|
||||
sInstance = new SiteIdentityPopup();
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public static SiteIdentityPopup getInstance() {
|
||||
return SiteIdentityPopup.InstanceHolder.INSTANCE;
|
||||
public static synchronized void clearInstance() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
|
Loading…
Reference in New Issue
Block a user