Exit gracefully if a port is bound by another process
This commit is contained in:
@@ -311,13 +311,15 @@ public:
|
||||
[[nodiscard]] ptr_t ref() {
|
||||
std::lock_guard lg { _lock };
|
||||
|
||||
if(!_count++) {
|
||||
if(!_count) {
|
||||
new(_object_buf.data()) element_type;
|
||||
if(_construct(*reinterpret_cast<element_type*>(_object_buf.data()))) {
|
||||
return ptr_t { nullptr };
|
||||
}
|
||||
}
|
||||
|
||||
++_count;
|
||||
|
||||
return ptr_t { this };
|
||||
}
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user