]> sigrok.org Git - pulseview.git/commit
Fix #970 by making sure the session state handler can be called
authorSoeren Apel <redacted>
Wed, 7 Jun 2017 16:18:24 +0000 (18:18 +0200)
committerSoeren Apel <redacted>
Wed, 7 Jun 2017 16:18:24 +0000 (18:18 +0200)
commitae1b6126c9a4e40ad2832e2b2e776f3a4a62e195
tree831760f3c9d2e6dc7775b91132d57bcc96f366ca
parentdc4ada2bfd5d9f4386661ffbf7ff3ad000b6bfb5
Fix #970 by making sure the session state handler can be called

Before, the session did call Session::stop_capture() and fired
the signal to notify of its capture state change. However, the
Session object was deleted before the next run of the Qt event
loop. As the Qt event loop dismisses signals originating from
deleted objects, the connected event handler
MainWindow::on_capture_state_changed() was never called.

To remedy this, we call Session::stop_capture() before the
destruction of the object and force a run of the event loop
immediately afterwards. This way, the event handler is called
and the run/stop button updated properly.
pv/mainwindow.cpp