-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix memory leak #3470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3/master
Are you sure you want to change the base?
Fix memory leak #3470
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -205,9 +205,12 @@ class TransactionAnchoredVariables { | |||||||||||||||||||||||||||
| m_variableFilesTmpNames(t, "FILES_TMPNAMES"), | ||||||||||||||||||||||||||||
| m_variableMultipartPartHeaders(t, "MULTIPART_PART_HEADERS"), | ||||||||||||||||||||||||||||
| m_variableOffset(0), | ||||||||||||||||||||||||||||
| m_variableArgsNames("ARGS_NAMES", &m_variableArgs), | ||||||||||||||||||||||||||||
| m_variableArgsGetNames("ARGS_GET_NAMES", &m_variableArgsGet), | ||||||||||||||||||||||||||||
| m_variableArgsPostNames("ARGS_POST_NAMES", &m_variableArgsPost) | ||||||||||||||||||||||||||||
| m_pVariableArgsNames(std::make_unique<AnchoredSetVariableTranslationProxy>("ARGS_NAMES", &m_variableArgs)), | ||||||||||||||||||||||||||||
| m_variableArgsNames(*m_pVariableArgsNames), | ||||||||||||||||||||||||||||
| m_pVariableArgsGetNames(std::make_unique<AnchoredSetVariableTranslationProxy>("ARGS_GET_NAMES", &m_variableArgsGet)), | ||||||||||||||||||||||||||||
| m_variableArgsGetNames(*m_pVariableArgsGetNames), | ||||||||||||||||||||||||||||
| m_pVariableArgsPostNames(std::make_unique<AnchoredSetVariableTranslationProxy>("ARGS_POST_NAMES", &m_variableArgsPost)), | ||||||||||||||||||||||||||||
| m_variableArgsPostNames(*m_pVariableArgsPostNames) | ||||||||||||||||||||||||||||
|
Comment on lines
+208
to
+213
|
||||||||||||||||||||||||||||
| { } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| AnchoredSetVariable m_variableRequestHeadersNames; | ||||||||||||||||||||||||||||
|
|
@@ -291,9 +294,12 @@ class TransactionAnchoredVariables { | |||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| int m_variableOffset; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| AnchoredSetVariableTranslationProxy m_variableArgsNames; | ||||||||||||||||||||||||||||
| AnchoredSetVariableTranslationProxy m_variableArgsGetNames; | ||||||||||||||||||||||||||||
| AnchoredSetVariableTranslationProxy m_variableArgsPostNames; | ||||||||||||||||||||||||||||
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsNames; | ||||||||||||||||||||||||||||
| AnchoredSetVariableTranslationProxy &m_variableArgsNames; | ||||||||||||||||||||||||||||
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsGetNames; | ||||||||||||||||||||||||||||
| AnchoredSetVariableTranslationProxy &m_variableArgsGetNames; | ||||||||||||||||||||||||||||
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsPostNames; | ||||||||||||||||||||||||||||
|
Comment on lines
+297
to
+301
|
||||||||||||||||||||||||||||
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsNames; | |
| AnchoredSetVariableTranslationProxy &m_variableArgsNames; | |
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsGetNames; | |
| AnchoredSetVariableTranslationProxy &m_variableArgsGetNames; | |
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsPostNames; | |
| private: | |
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsNames; | |
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsGetNames; | |
| std::unique_ptr<AnchoredSetVariableTranslationProxy> m_pVariableArgsPostNames; | |
| public: | |
| AnchoredSetVariableTranslationProxy &m_variableArgsNames; | |
| AnchoredSetVariableTranslationProxy &m_variableArgsGetNames; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description states
m_variableArgs*Nameswere previously references bound to heap allocations (so destructors couldn’t free them). In this header, they were value members before this change, and this diff actually introduces reference members + heap allocation. Can you clarify the leak reproduction and why switching to heap allocation is necessary here? As-is, this change doesn’t match the described root cause.