jankae / LibreCAL

4 port eCal module
GNU General Public License v3.0
60 stars 19 forks source link

LibreCAL-GUI Coefficient -> Load From Device crash at end #17

Closed bvernoux closed 1 year ago

bvernoux commented 1 year ago

How to reproduce the issue:

This issue is triggered when appwindow.cpp AppWindow::loadCoefficients() => call the code delete d; due to the fact some threads are not finished and report updated progress ... to QProgressDialog and it is deleted.

jankae commented 1 year ago

Thank you very much for tracking down the issue. I couldn't replicate it and think the code should be working because all connected lambdas that are handling code for d also have d as the receiver for the slot. This should prevent the slot from being executed after d has been deleted. But maybe I did miss something and depending on the thread timing it can still crash. I also think your proposed solution is an easy way to avoid this problem altogether, so I implemented it with 0ccba625 Please let me know if this fixes the crash for you.

bvernoux commented 1 year ago

Thanks for the fast feedback and the fix I confirm it definitely solve the crash issue now (tested with success with 1601 pts when before it was crashing each time at end) image