make Mackie::Surface keep a reference to the input source+channel and clean up in destructor

This commit is contained in:
Paul Davis 2015-10-08 21:23:48 -04:00
parent ce03b02a79
commit 7e10c21468
3 changed files with 47 additions and 6 deletions

View file

@ -92,6 +92,8 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
, _master_fader (0)
, _last_master_gain_written (-0.0f)
, connection_state (0)
, input_channel (0)
, input_source (0)
{
DEBUG_TRACE (DEBUG::MackieControl, "Surface::Surface init\n");
@ -162,6 +164,16 @@ Surface::~Surface ()
port_connection.disconnect ();
if (input_source) {
g_source_destroy (input_source);
input_source = 0;
}
if (input_channel) {
g_io_channel_unref (input_channel);
input_channel = 0;
}
delete _jog_wheel;
delete _port;