Blame SOURCES/0001-objectManager-correct-invalid-index-code-in-onNameVa.patch

42f94a
From 8a44f57228ca3b7bcf1e79848dec8f790870afc8 Mon Sep 17 00:00:00 2001
42f94a
From: Ray Strode <rstrode@redhat.com>
42f94a
Date: Fri, 31 Aug 2018 12:48:00 -0400
42f94a
Subject: [PATCH 1/4] objectManager: correct invalid index code in
42f94a
 onNameVanished
42f94a
42f94a
The object manager tries to synthesize interface removal
42f94a
events if the bus name of a remote object drops off the bus.
42f94a
42f94a
The code has a bad typo in it, though: it confuses `objectPaths`
42f94a
(the list of all object paths) and `objectPath` (the object
42f94a
currently being processed this iteration of the loop).
42f94a
42f94a
That leads to a failure to synthesize the interface removal
42f94a
events, and spew in the log.
42f94a
42f94a
This commit corrects the objectPath/objectPaths confusion.
42f94a
---
42f94a
 js/misc/objectManager.js | 3 ++-
42f94a
 1 file changed, 2 insertions(+), 1 deletion(-)
42f94a
42f94a
diff --git a/js/misc/objectManager.js b/js/misc/objectManager.js
42f94a
index 1ce4f8342..5dffaa130 100644
42f94a
--- a/js/misc/objectManager.js
42f94a
+++ b/js/misc/objectManager.js
42f94a
@@ -209,61 +209,62 @@ var ObjectManager = new Lang.Class({
42f94a
             let [objects] = result;
42f94a
 
42f94a
             if (!objects) {
42f94a
                 this._tryToCompleteLoad();
42f94a
                 return;
42f94a
             }
42f94a
 
42f94a
             let objectPaths = Object.keys(objects);
42f94a
             for (let i = 0; i < objectPaths.length; i++) {
42f94a
                 let objectPath = objectPaths[i];
42f94a
                 let object = objects[objectPath];
42f94a
 
42f94a
                 let interfaceNames = Object.getOwnPropertyNames(object);
42f94a
                 for (let j = 0; j < interfaceNames.length; j++) {
42f94a
                     let interfaceName = interfaceNames[j];
42f94a
 
42f94a
                     // Prevent load from completing until the interface is loaded
42f94a
                     this._numLoadInhibitors++;
42f94a
                     this._addInterface(objectPath,
42f94a
                                        interfaceName,
42f94a
                                        this._tryToCompleteLoad.bind(this));
42f94a
                 }
42f94a
             }
42f94a
             this._tryToCompleteLoad();
42f94a
         });
42f94a
     },
42f94a
 
42f94a
     _onNameVanished() {
42f94a
         let objectPaths = Object.keys(this._objects);
42f94a
         for (let i = 0; i < objectPaths.length; i++) {
42f94a
-            let object = this._objects[objectPaths];
42f94a
+            let objectPath = objectPaths[i];
42f94a
+            let object = this._objects[objectPath];
42f94a
 
42f94a
             let interfaceNames = Object.keys(object);
42f94a
             for (let j = 0; i < interfaceNames.length; i++) {
42f94a
                 let interfaceName = interfaceNames[i];
42f94a
 
42f94a
                 if (object[interfaceName])
42f94a
                     this._removeInterface(objectPath, interfaceName);
42f94a
             }
42f94a
         }
42f94a
     },
42f94a
 
42f94a
     _registerInterfaces(interfaces) {
42f94a
         for (let i = 0; i < interfaces.length; i++) {
42f94a
             let info = Gio.DBusInterfaceInfo.new_for_xml(interfaces[i]);
42f94a
             this._interfaceInfos[info.name] = info;
42f94a
         }
42f94a
     },
42f94a
 
42f94a
     getProxy(objectPath, interfaceName) {
42f94a
         let object = this._objects[objectPath];
42f94a
 
42f94a
         if (!object)
42f94a
             return null;
42f94a
 
42f94a
         return object[interfaceName];
42f94a
     },
42f94a
 
42f94a
     getProxiesForInterface(interfaceName) {
42f94a
         let proxyList = this._interfaces[interfaceName];
42f94a
 
42f94a
-- 
42f94a
2.21.0
42f94a