Bug 676316 - Reverse the device motion listener removal early return logic. r=dougt
authorJosh Matthews <josh@joshmatthews.net>
Fri, 05 Aug 2011 10:33:06 -0400
changeset 73910 899a225fd580f3d05f1916df40cad91ea98af496
parent 73909 fc40a7ae42cae6fde58084882e62930b24ce8ed4
child 73911 d68a492dcabe4a3e6d9bbdaebc0f64c795b1611b
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