]> sigrok.org Git - pulseview.git/commit
Fix #605 by closing current device when another is selected
authorSoeren Apel <redacted>
Fri, 4 Sep 2015 01:34:08 +0000 (03:34 +0200)
committerSoeren Apel <redacted>
Fri, 4 Sep 2015 01:34:08 +0000 (03:34 +0200)
commit4d6c6ea3e6b069787c270d4911083dae05eae4c6
tree652668ae77bd151d167d0dbae66efcc391337b02
parentaccd9c0506657c2444caef9aa3aa5de71a94b60a
Fix #605 by closing current device when another is selected

As the device manager class holds a pointer to all devices
they will never be destroyed until PV exits. Devices are
opened with the first call to create() but only closed in
the destructor. Together, this results in devices never
being closed.

This patch fixes this by renaming create() to open()
and introducing a matching close() method that the
session class calls when a different device is to be
selected.
pv/devices/device.hpp
pv/devices/hardwaredevice.cpp
pv/devices/hardwaredevice.hpp
pv/devices/inputfile.cpp
pv/devices/inputfile.hpp
pv/devices/sessionfile.cpp
pv/devices/sessionfile.hpp
pv/session.cpp