Review Request 124361: Fix battery widget not appearing after kdeconnectd restarts

Lamarque Souza lamarque at kde.org
Fri Jul 17 03:39:15 UTC 2015



> On July 16, 2015, 5:37 p.m., Albert Vaca Cintora wrote:
> > plugins/battery/batterydbusinterface.cpp, line 37
> > <https://git.reviewboard.kde.org/r/124361/diff/1/?file=385450#file385450line37>
> >
> >     So this deletes the old DBusAdaptor after we add a new one, and this doesn't crash as opposed as deleting it on destroy, am I right? It's kind of weird :/ Maybe add a comment explaining this?

You are right. I guess the new BatteryDbusInterface assumes all dbus requests and the old one is completely removed from the bus. Maybe someone that knows dbus better can confirm that. I will add this comment "This makes the old BatteryDdbusInterface be deleted only after the new one is fully operational. That seems to prevent the crash mentioned in BatteryPlugin's destructor."


- Lamarque


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124361/#review82578
-----------------------------------------------------------


On July 15, 2015, 11:52 a.m., Lamarque Souza wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124361/
> -----------------------------------------------------------
> 
> (Updated July 15, 2015, 11:52 a.m.)
> 
> 
> Review request for kdeconnect.
> 
> 
> Repository: kdeconnect-kde
> 
> 
> Description
> -------
> 
> Sometimes (just sometimes) battery widget does not show up at system tray when I log in. After I restart kdeconnectd I see the message "dbus interface not valid" in my session's log and the battery widget still does not appear. After some investigation it seems m_dbusInterface is becoming invalid and consequently DevicesModel::refreshDeviceList() does nothing. This patch works around this problem.
> 
> I added another workaround to fix the memory leak described in 0f38eb34a4ee25f5a1c182822cebe5b44c788aaa. The leaked object is the same one reported as invalid by DevicesModel::refreshDeviceList(), so maybe the problem is related.
> 
> Oddly, there is no bug entry in bugs.kde.org about this problem.
> 
> 
> Diffs
> -----
> 
>   interfaces/devicesmodel.h 816810e 
>   interfaces/devicesmodel.cpp 3ac68ab 
>   plugins/battery/batterydbusinterface.h fb5d768 
>   plugins/battery/batterydbusinterface.cpp 4b885ff 
> 
> Diff: https://git.reviewboard.kde.org/r/124361/diff/
> 
> 
> Testing
> -------
> 
> Battery widget appears again when my phone's kdeconnect agent sends any dbus update signal to kdeconnect-kde. No crashes due to deleting BatteryDbusInterface object.
> 
> 
> Thanks,
> 
> Lamarque Souza
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20150717/9679afd2/attachment.html>


More information about the KDEConnect mailing list