Commit f2509279 authored by David Redondo's avatar David Redondo 🏎

Do not update sysctl sensor if it is not subscribed

parent fbd7c1e3
......@@ -45,6 +45,9 @@ SysctlSensor<T>::SysctlSensor(const QString& id, const QByteArray &sysctlName, S
template <typename T>
void SysctlSensor<T>::update()
{
if (!isSubscribed()) {
return;
}
T value;
size_t size = sizeof(T);
if (sysctlbyname(m_sysctlName.constData(), &value, &size, nullptr, 0) != -1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment