[PR #411] [MERGED] Use explicit memory ownership in SocketMultiplexer #1627

Closed
opened 2026-05-05 07:58:00 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/debauchee/barrier/pull/411
Author: @p12tic
Created: 8/22/2019
Status: Merged
Merged: 8/22/2019
Merged by: @AdrianKoshka

Base: masterHead: rewrite-memory-management


📝 Commits (2)

  • 8dd6bc2 Make ownership of SocketMultiplexer explicit
  • a841b28 Make ownership of SocketMultiplexerJob explicit

📊 Changes

14 files changed (+156 additions, -154 deletions)

View changed files

📝 src/lib/barrier/App.cpp (+1 -1)
📝 src/lib/barrier/App.h (+5 -3)
📝 src/lib/barrier/ClientApp.cpp (+1 -2)
📝 src/lib/barrier/ServerApp.cpp (+1 -2)
📝 src/lib/net/ISocketMultiplexerJob.h (+22 -9)
📝 src/lib/net/SecureSocket.cpp (+23 -20)
📝 src/lib/net/SecureSocket.h (+3 -9)
📝 src/lib/net/SocketMultiplexer.cpp (+34 -38)
📝 src/lib/net/SocketMultiplexer.h (+3 -4)
📝 src/lib/net/TCPListenSocket.cpp (+13 -14)
📝 src/lib/net/TCPListenSocket.h (+2 -4)
📝 src/lib/net/TCPSocket.cpp (+34 -27)
📝 src/lib/net/TCPSocket.h (+7 -10)
📝 src/lib/net/TSocketMultiplexerMethodJob.h (+7 -11)

📄 Description

The code of SocketMultiplexer is extremely hard to follow, as the ownership of various data is not clear. This PR fixes that by making ownership explicit by using std::unique_ptr. While no memory leaks have been detected or fixed, this will make this basically impossible in the future.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/debauchee/barrier/pull/411 **Author:** [@p12tic](https://github.com/p12tic) **Created:** 8/22/2019 **Status:** ✅ Merged **Merged:** 8/22/2019 **Merged by:** [@AdrianKoshka](https://github.com/AdrianKoshka) **Base:** `master` ← **Head:** `rewrite-memory-management` --- ### 📝 Commits (2) - [`8dd6bc2`](https://github.com/debauchee/barrier/commit/8dd6bc2c55f91c0d3048822bb25f6b668e22da3d) Make ownership of SocketMultiplexer explicit - [`a841b28`](https://github.com/debauchee/barrier/commit/a841b2858f178a0da41efa520e87b73fb8b24189) Make ownership of SocketMultiplexerJob explicit ### 📊 Changes **14 files changed** (+156 additions, -154 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/barrier/App.cpp` (+1 -1) 📝 `src/lib/barrier/App.h` (+5 -3) 📝 `src/lib/barrier/ClientApp.cpp` (+1 -2) 📝 `src/lib/barrier/ServerApp.cpp` (+1 -2) 📝 `src/lib/net/ISocketMultiplexerJob.h` (+22 -9) 📝 `src/lib/net/SecureSocket.cpp` (+23 -20) 📝 `src/lib/net/SecureSocket.h` (+3 -9) 📝 `src/lib/net/SocketMultiplexer.cpp` (+34 -38) 📝 `src/lib/net/SocketMultiplexer.h` (+3 -4) 📝 `src/lib/net/TCPListenSocket.cpp` (+13 -14) 📝 `src/lib/net/TCPListenSocket.h` (+2 -4) 📝 `src/lib/net/TCPSocket.cpp` (+34 -27) 📝 `src/lib/net/TCPSocket.h` (+7 -10) 📝 `src/lib/net/TSocketMultiplexerMethodJob.h` (+7 -11) </details> ### 📄 Description The code of SocketMultiplexer is extremely hard to follow, as the ownership of various data is not clear. This PR fixes that by making ownership explicit by using `std::unique_ptr`. While no memory leaks have been detected or fixed, this will make this basically impossible in the future. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 07:58:00 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#1627
No description provided.