Merge pull request #3554 from 3u13r/fix/upower/dont-override-existing-upDevice
fix/upower: upower module selection with multiple devices
This commit is contained in:
commit
30f6ed05ec
|
@ -384,10 +384,11 @@ void UPower::setDisplayDevice() {
|
||||||
displayDevice = upDevice;
|
displayDevice = upDevice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Unref current upDevice
|
// Unref current upDevice if it exists
|
||||||
if (displayDevice.upDevice != NULL) g_object_unref(thisPtr->upDevice_.upDevice);
|
if (displayDevice.upDevice != NULL) {
|
||||||
// Reassign new upDevice
|
if (thisPtr->upDevice_.upDevice != NULL) g_object_unref(thisPtr->upDevice_.upDevice);
|
||||||
thisPtr->upDevice_ = displayDevice;
|
thisPtr->upDevice_ = displayDevice;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue