Skip to content

chore: Delete copy ctor/assign for GIL RAIIs - #4183

Merged
Skylion007 merged 3 commits into
pybind:masterfrom
Skylion007:gil-delete-spec-members
Sep 19, 2022
Merged

chore: Delete copy ctor/assign for GIL RAIIs#4183
Skylion007 merged 3 commits into
pybind:masterfrom
Skylion007:gil-delete-spec-members

Conversation

@Skylion007

Copy link
Copy Markdown
Collaborator

Description

I noticed some of the GIL RAIIs still had their potential copy assignment operators so I made sure they were explicitly deleted. This should prevent bugprone behavior of trying to copy them / move them around.

Suggested changelog entry:

* GIL RAII scopes are non-copyable to avoid potential bugs.

@rwgkrwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!
It might be good to add the two lines to gil_scoped_acquire_local in detail/internals.h as well. Not that it matters for the code as is, but these kind of fragments tend to get copied around. Having it complete there as well, the oversight/omission won't spread.

@Skylion007
Skylion007 marked this pull request as ready for review September 19, 2022 16:06

@rwgkrwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@Skylion007
Skylion007 merged commit 9c04c7b into pybind:masterSep 19, 2022
@Skylion007
Skylion007 deleted the gil-delete-spec-members branch September 19, 2022 16:56
@github-actionsgithub-actionsBot added the needs changelog Possibly needs a changelog entry label Sep 19, 2022
@henryiiihenryiii removed the needs changelog Possibly needs a changelog entry label Oct 20, 2022
@rwgkrwgk mentioned this pull request Feb 10, 2023
Sign up for freeto 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.

3 participants

@Skylion007@rwgk@henryiii