mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-14 20:40:03 +02:00
Add noexcept qualifications in src/common
Apparently this can actually make a difference in some cases, and the C++ Core Guideliens recommend doing this on all default constructors, destructors, and all functions that can not throw (and thus also don't allocate).
This commit is contained in:
@@ -217,7 +217,7 @@ class Sockets {
|
||||
*
|
||||
* @note Classes overriding this should call `close()` in their destructor.
|
||||
*/
|
||||
virtual ~Sockets() {
|
||||
virtual ~Sockets() noexcept {
|
||||
try {
|
||||
// NOTE: Because someone has wiped their home directory in the past
|
||||
// by manually modifying the socket base directory argument
|
||||
@@ -239,6 +239,9 @@ class Sockets {
|
||||
// There should not be any filesystem errors since only one side
|
||||
// removes the files, but if we somehow can't delete the file
|
||||
// then we can just silently ignore this
|
||||
} catch (const std::bad_alloc&) {
|
||||
// If we cannot clean up because we're out of memory, then that's
|
||||
// fine
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user