Skip to content

Commit

Permalink
[desrt] network: properly remove connections from list
Browse files Browse the repository at this point in the history
Due to a typo we were always removing the first (index 0) connection
from the global list of connections instead of the correct one.

This resulted in some connections remaining in the shell's connection
list long after they were removed.  In particular, this resulted in
multiple copies of a bluetooth connection appearing after suspend/resume
(when the device was readded and the cached connection list was
rescanned).

GNOME/gnome-shell@3d4408d
  • Loading branch information
clefebvre committed Jun 21, 2016
1 parent e44c771 commit 575a32c
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -1867,6 +1867,7 @@ MyApplet.prototype = {
// already seen, not adding again
return;
}
log(device.get_device_type());
let wrapperClass = this._dtypes[device.get_device_type()];
if (wrapperClass) {
let wrapper = new wrapperClass(this._client, device, this._connections);
Expand Down Expand Up @@ -2074,7 +2075,7 @@ MyApplet.prototype = {
_connectionRemoved: function(connection) {
let pos = this._connections.indexOf(connection);
if (pos != -1)
this._connections.splice(connection);
this._connections.splice(pos);

let section = connection._section;

Expand Down

0 comments on commit 575a32c

Please sign in to comment.