From de2eb79d3c1f4c6bc4e89553761874f011bce811 Mon Sep 17 00:00:00 2001
From: John Maguire <john.maguire@gmail.com>
Date: Sat, 24 Jul 2010 19:41:30 +0000
Subject: [PATCH] Fix crash on device removal.

---
 src/devices/devicemanager.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/devices/devicemanager.cpp b/src/devices/devicemanager.cpp
index 29a6820e4..be4b9155d 100644
--- a/src/devices/devicemanager.cpp
+++ b/src/devices/devicemanager.cpp
@@ -342,9 +342,9 @@ void DeviceManager::PhysicalDeviceRemoved(const QString &id) {
 
   if (info.database_id_ != -1) {
     // Keep the structure around, but just "disconnect" it
-    for (int backend_index = 0 ; backend_index < info.backends_.count() ; ++i) {
-      if (info.backends_[i].unique_id_ == id) {
-        info.backends_[i].lister_ = NULL;
+    for (int backend_index = 0 ; backend_index < info.backends_.count() ; ++backend_index) {
+      if (info.backends_[backend_index].unique_id_ == id) {
+        info.backends_[backend_index].lister_ = NULL;
         break;
       }
     }