When some SensorClients are destroyed, eg. when KSysguard is closed,
they fail to deregister themselves from SensorAgent. This may cause a
crash when further messages arrive for them. This patch fixes that.
BUG: 350140
davidedmundson | |
ahiemstra |
When some SensorClients are destroyed, eg. when KSysguard is closed,
they fail to deregister themselves from SensorAgent. This may cause a
crash when further messages arrive for them. This patch fixes that.
BUG: 350140
No Linters Available |
No Unit Test Coverage |
Buildable 26679 | |
Build 26697: arc lint + arc unit |
gui/SensorBrowser.cpp | ||
---|---|---|
53 | When you delete the map content, all agents should loose their connections, no? |
gui/SensorBrowser.cpp | ||
---|---|---|
53 | No, it only deletes the HostInfo structure. See the source. It doesn't disconnect anything. Nor does deleting this, as the Agent holds the client as a bare pointer, it can't know that it ceased to exist. It isn't even a QPointer (probably bc. SensorClient isn't a QObject). |
gui/SensorBrowser.cpp | ||
---|---|---|
53 | But the host info, at least in its present form, doesn't have the client pointer to pass to disconnectClient. But I can see your point, I will change it. |
Move the client deregistering code from SensorBrowserModel to HostInfo
Also remove the clear function. After investigating further, I've
found out it suffers from the same problem, that it doesn't deregister
from the hosts it removes. On top of that, it leaves dangling pointers
in mSensorInfoMap. It doesn't really clear all the other internal
structures. And it is never used. So I think it's best to delete it.