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;
|
||||
}
|
||||
}
|
||||
// Unref current upDevice
|
||||
if (displayDevice.upDevice != NULL) g_object_unref(thisPtr->upDevice_.upDevice);
|
||||
// Reassign new upDevice
|
||||
// Unref current upDevice if it exists
|
||||
if (displayDevice.upDevice != NULL) {
|
||||
if (thisPtr->upDevice_.upDevice != NULL) g_object_unref(thisPtr->upDevice_.upDevice);
|
||||
thisPtr->upDevice_ = displayDevice;
|
||||
}
|
||||
},
|
||||
this);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue