mirror of git://sigrok.org/pulseview
7f894d958e
Passing segment instances fails because this creates a race condition. When a long conversion is taking place, the SignalBase::samples_added signal is called often but since it's in a separate thread, the calls are queued and aren't executed immediately. Now if the conversion is restarted - for example as a result of a changed conversion threshold - then the segments holding the converted data are destroyed, rendering the pointers submitted as parameters to samples_added invalid. Once the signal queue is processed, those invalid pointers will be accessed and PV segfaults. Since the signal queue can neither be emptied nor flushed, this leaves only two sensible choices: 1) Signal samples_added less often, thereby reducing the chance of signals being queued 2) Supply the segment ID instead of the segment instance as that's essentially the only thing we currently care about - in fact, the only user of samples_added (ViewBase::on_samples_added) uses the instance to query only this As #1 is only a band-aid and not a waterproof solution, I chose to go with #2. |
||
---|---|---|
.. | ||
binding | ||
data | ||
devices | ||
dialogs | ||
popups | ||
prop | ||
toolbars | ||
views | ||
widgets | ||
application.cpp | ||
application.hpp | ||
devicemanager.cpp | ||
devicemanager.hpp | ||
globalsettings.cpp | ||
globalsettings.hpp | ||
mainwindow.cpp | ||
mainwindow.hpp | ||
session.cpp | ||
session.hpp | ||
storesession.cpp | ||
storesession.hpp | ||
strnatcmp.hpp | ||
util.cpp | ||
util.hpp |