Fix crash in NotificationsPlugin
AbandonedPublic

Authored by nicolasfella on Jan 24 2018, 8:36 PM.

Details

Reviewers
albertvaka
tfella
Group Reviewers
KDE Connect
Summary

When running Spotify on the desktop and phone simultaneously the playback notification gets updated multiple times very fast. This leads to a crash in the notificationsplugin because the notification is updated before it's actually added to the list. This leads to the icon not being transfered correctly and crashes.
Added a mutex to prevent concurrent access to the tmp file.

Test Plan

Run Spotify on Desktop and phone. Restart Spotify phone app. Doesn't crash any more.

Diff Detail

Repository
R224 KDE Connect
Branch
notifix
Lint
No Linters Available
Unit
No Unit Test Coverage
tfella requested review of this revision.Jan 24 2018, 8:36 PM
tfella created this revision.
albertvaka accepted this revision.Jan 24 2018, 9:39 PM
This revision is now accepted and ready to land.Jan 24 2018, 9:39 PM
anthonyfieroni added inline comments.
plugins/notifications/notification.cpp
35

Never deleted.

113

It will make a deadlock if loadIcon does not get called i.e. applyNoIcon or applyIcon

nicolasfella requested changes to this revision.Feb 2 2018, 12:06 AM
This revision now requires changes to proceed.Feb 2 2018, 12:06 AM