Bug 735781 - Make sure nsScreen don't call RemoveObserver twice in a row. r=jlebar

This commit is contained in:
Mounir Lamouri 2012-03-15 10:58:56 +01:00
parent e545a790d6
commit 675be045de
2 changed files with 1 additions and 8 deletions

View File

@ -1313,7 +1313,6 @@ nsGlobalWindow::FreeInnerObjects()
} }
if (mScreen) { if (mScreen) {
mScreen->Invalidate();
mScreen = nsnull; mScreen = nsnull;
} }

View File

@ -84,12 +84,6 @@ nsScreen::Initialize()
"dom.screenBrightnessProperty.enabled"); "dom.screenBrightnessProperty.enabled");
} }
void
nsScreen::Invalidate()
{
hal::UnregisterScreenOrientationObserver(this);
}
/* static */ already_AddRefed<nsScreen> /* static */ already_AddRefed<nsScreen>
nsScreen::Create(nsPIDOMWindow* aWindow) nsScreen::Create(nsPIDOMWindow* aWindow)
{ {
@ -120,7 +114,7 @@ nsScreen::nsScreen()
nsScreen::~nsScreen() nsScreen::~nsScreen()
{ {
Invalidate(); hal::UnregisterScreenOrientationObserver(this);
} }