Skip to content

gh-145376: Fix various refleaks Objects/#145609

Open
eendebakpt wants to merge 10 commits intopython:mainfrom
eendebakpt:refleaks_misc
Open

gh-145376: Fix various refleaks Objects/#145609
eendebakpt wants to merge 10 commits intopython:mainfrom
eendebakpt:refleaks_misc

Conversation

@eendebakpt
Copy link
Contributor

@eendebakpt eendebakpt commented Mar 6, 2026

attr_old = getattrs(self->win);
if (curses_wattrset(self, attr, "addstr") < 0) {
curses_release_wstr(strtype, wstr);
Py_DECREF(bytesobj);
Copy link
Member

Choose a reason for hiding this comment

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

Be careful here. PyCurses_ConvertToString has a weird return type so you might not necessarily have bytesobj set to something (it might be in wstr instead).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Member

Choose a reason for hiding this comment

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

Could you move this line after the if instead so we don't have to worry about cleaning up the ref?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants