Skip to content

Refactor using smart pointer to avoid memory leaks#87

Merged
doctorlai-msrc merged 1 commit intomainfrom
zhihua/smartpointers
Sep 23, 2025
Merged

Refactor using smart pointer to avoid memory leaks#87
doctorlai-msrc merged 1 commit intomainfrom
zhihua/smartpointers

Conversation

@doctorlai-msrc
Copy link
Copy Markdown
Collaborator

@doctorlai-msrc doctorlai-msrc commented Sep 22, 2025

This PR refactors the JrtcApp::Init() using smart pointer e.g. unique_ptr to avoid the memory leaks, for example, if any errors occur before the following, there will be memory leaks.

if (si.chan_ctx) {
    jrtc_router_channel_destroy(si.chan_ctx);
}

The changes are verified by existing integration tests.

@doctorlai-msrc doctorlai-msrc marked this pull request as ready for review September 22, 2025 21:05
@doctorlai-msrc doctorlai-msrc added this pull request to the merge queue Sep 23, 2025
Merged via the queue into main with commit 3d75144 Sep 23, 2025
10 of 13 checks passed
@doctorlai-msrc doctorlai-msrc deleted the zhihua/smartpointers branch September 23, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants