D29616: Fix memory errors caused by using dangling pointers to SensorClients in SensorAgent

2020-05-11 Thread Jiří Paleček
jpalecek updated this revision to Diff 82568. jpalecek added a comment. 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 t

D29616: Fix memory errors caused by using dangling pointers to SensorClients in SensorAgent

2020-05-11 Thread Jiří Paleček
jpalecek added inline comments. INLINE COMMENTS > ahiemstra wrote in SensorBrowser.cpp:53 > I agree with Anthony though, if you delete a hostInfo it _should_ remove its > connection. So it's better to move this code into a destructor for HostInfo. But the host info, at least in its present form

D29616: Fix memory errors caused by using dangling pointers to SensorClients in SensorAgent

2020-05-11 Thread Arjen Hiemstra
ahiemstra requested changes to this revision. ahiemstra added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > jpalecek wrote in SensorBrowser.cpp:53 > No, it only deletes the HostInfo structure. See the source >

D29616: Fix memory errors caused by using dangling pointers to SensorClients in SensorAgent

2020-05-11 Thread Jiří Paleček
jpalecek added inline comments. INLINE COMMENTS > anthonyfieroni wrote in SensorBrowser.cpp:53 > When you delete the map content, all agents should loose their connections, > no? No, it only deletes the HostInfo structure. See the source

D29616: Fix memory errors caused by using dangling pointers to SensorClients in SensorAgent

2020-05-10 Thread Anthony Fieroni
anthonyfieroni added inline comments. INLINE COMMENTS > SensorBrowser.cpp:53 > +} > qDeleteAll( mHostInfoMap ); > mHostInfoMap.clear(); When you delete the map content, all agents should loose their connections, no? REPOSITORY R106 KSysguard REVISION DETAIL https://phabricato

D29616: Fix memory errors caused by using dangling pointers to SensorClients in SensorAgent

2020-05-10 Thread Jiří Paleček
jpalecek created this revision. jpalecek added reviewers: davidedmundson, ahiemstra. Herald added a project: Plasma. jpalecek requested review of this revision. REVISION SUMMARY When some SensorClients are destroyed, eg. when KSysguard is closed, they fail to deregister themselves from Sensor