diff options
author | Chris Robinson <[email protected]> | 2021-06-11 13:43:01 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-06-11 13:43:01 -0700 |
commit | 241107faebf074462472ad9d49921399d9d5235a (patch) | |
tree | 012f1fd8ef7ce44da2885a780bb56f130fe529d9 | |
parent | f5bcd12be1c748122aeda0d00a289f866036269e (diff) |
Give a name to a lambda
-rw-r--r-- | alc/backends/jack.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp index 15e5c462..349a6356 100644 --- a/alc/backends/jack.cpp +++ b/alc/backends/jack.cpp @@ -315,11 +315,11 @@ JackPlayback::~JackPlayback() if(!mClient) return; - std::for_each(mPort.begin(), mPort.end(), - [this](jack_port_t *port) -> void - { if(port) jack_port_unregister(mClient, port); } - ); + auto unregister_port = [this](jack_port_t *port) -> void + { if(port) jack_port_unregister(mClient, port); }; + std::for_each(mPort.begin(), mPort.end(), unregister_port); mPort.fill(nullptr); + jack_client_close(mClient); mClient = nullptr; } @@ -497,9 +497,9 @@ void JackPlayback::open(const char *name) bool JackPlayback::reset() { - std::for_each(mPort.begin(), mPort.end(), - [this](jack_port_t *port) -> void - { if(port) jack_port_unregister(mClient, port); }); + auto unregister_port = [this](jack_port_t *port) -> void + { if(port) jack_port_unregister(mClient, port); }; + std::for_each(mPort.begin(), mPort.end(), unregister_port); mPort.fill(nullptr); /* Ignore the requested buffer metrics and just keep one JACK-sized buffer |