Move AMSMessage to smart pointer
Open
@lpottier is already working on this.
Since Mar 21, 2025.
- Dominant language
- C++
- Stars
- 10
- Forks
- 8
- Avg merge
- 17d 21h
- Merged PRs (30d)
- 1
Description
`AMSMessage` currently introduces a memory leak if it not used properly.
```c++
void foo() {
AMSMessage msg (...);
// code here...
} // msg._data is not freed here
```
But if you create a `shared_ptr` you are good:
```c++
void foo() {
AMSMessage msg (...);
std::shared_ptr ptr(msg.data());
} // msg._data is freed here
```
However, it is counterintuitive and not RAII.
Ideally, `msg._data` would be smart pointer from the beginning.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.