Skip to content

[swig] fix memory leak in swig interface - #6923

Merged
jameslamb merged 2 commits into
lightgbm-org:masterfrom
s-rwe:issue-6922
Jun 20, 2025
Merged

jameslamb merged 2 commits into
lightgbm-org:masterfrom
s-rwe:issue-6922

Conversation

@s-rwe

@s-rwe s-rwe commented May 21, 2025

Copy link
Copy Markdown
Contributor

Add %newobject declaractions for some functions returning strings, so generated wrappers release the respective memory accordingly.

Add %newobject declaractions for some functions returning
strings, so generated wrappers release the respective
memory accordingly.
@jameslamb jameslamb added the fix label May 22, 2025
@jameslamb jameslamb changed the title [swig] patch for memory leak in swig interface #6922 [swig] fix memory leak in swig interface Jun 16, 2025
@jameslamb

Copy link
Copy Markdown
Member

/AzurePipelines run

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

Sorry for the delay, we've had some significant CI challenges recently (#6918, for example). I've merged in latest master and started CI here.

I'm not very familiar with SWIG, but these changes look great to me based on the description of %newobject here: https://www.swig.org/Doc1.3/Customization.html#ownership

I looked through the rest of this file and don't see any other functions that I think should also be annotated in this way.

@jameslamb
jameslamb merged commit a547764 into lightgbm-org:master Jun 20, 2025
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/lightgbm-org/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants