Closed alexmalykh closed 3 years ago
First of all thanks for quick patch, it looks good to me. Regarding thread safe, well since the calls seem synched i think the problem could be on self._nid tha should be a GVariant * if I'm not wrong, so always if i'm not wrong the risk could be on calling hide() (remove_notification) with a null pointer (and that can be tested apart using pystray) or while another notifcation arrives before timer expiring. Maybe this last can be tested by pressing check for updates soon after the notification rises and increasing the timer expiration time to make it happening. Another test that can be performed could be to exit dnfdragora-updater before the timer expires, just to be sure thread it does not hang.
If we have no crashes i think we can also assume to loose a balloon from time to time maybe... :) Thanks again
Ok, thanks.
A possible fix for #178. Added a subclass of
pystray.Icon
with.notify()
method overriden. It schedules a calling of.remove_notification()
usingthreading.Timer
right away after creating a notification request. Not sure if it is thread-safe, but it looks working.