Skip to content

Commit d4cbb74

Browse files
authored
Fix crash when closing TCP connections
- replaced remove_if() with find_if(), because removing an unique_ptr from a vector causes it to become null, causing a crash later when we try to dereference it.
1 parent 65dd6a8 commit d4cbb74

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

blocks/OSC/src/cinder/osc/Osc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ asio::error_code ReceiverTcp::closeConnection( uint64_t connectionIdentifier, as
16051605
return ec;
16061606

16071607
std::lock_guard<std::mutex> lock( mConnectionMutex );
1608-
auto rem = remove_if( mConnections.begin(), mConnections.end(),
1608+
auto rem = find_if( mConnections.begin(), mConnections.end(),
16091609
[connectionIdentifier]( const UniqueConnection &cached ) {
16101610
return cached->mIdentifier == connectionIdentifier;
16111611
} );

0 commit comments

Comments
 (0)