Bug 676316 - Reverse the device motion listener removal early return logic. r=dougt
authorJosh Matthews <josh@joshmatthews.net>
Thu, 04 Aug 2011 18:22:45 -0400
changeset 73902 be090ee1747a378bef88e392164ad01548d912ed
parent 73901 c7931e07dd4dcda4916d58753bfdb933372e8148
child 73903 e8fa46a9db70e6099a7b446c7ce1111a292eca9f
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersdougt
bugs676316
milestone8.0a1
Bug 676316 - Reverse the device motion listener removal early return logic. r=dougt
dom/system/nsDeviceMotion.cpp
--- a/dom/system/nsDeviceMotion.cpp
+++ b/dom/system/nsDeviceMotion.cpp
@@ -204,17 +204,17 @@ NS_IMETHODIMP nsDeviceMotion::AddWindowL
   }
   if (mWindowListeners.IndexOf(aWindow) == NoIndex)
     mWindowListeners.AppendElement(aWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsDeviceMotion::RemoveWindowListener(nsIDOMWindow *aWindow)
 {
-  if (mWindowListeners.IndexOf(aWindow) != NoIndex)
+  if (mWindowListeners.IndexOf(aWindow) == NoIndex)
     return NS_OK;
 
   mWindowListeners.RemoveElement(aWindow);
   StartDisconnectTimer();
   return NS_OK;
 }
 
 NS_IMETHODIMP