Skip to content

Commit

Permalink
bugfix: delete proper ctors in gil.h (#4490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylion007 authored Feb 4, 2023
1 parent 3efe9d4 commit 08a89fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/pybind11/gil.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ class gil_scoped_release {
}
}

gil_scoped_release(const gil_scoped_acquire &) = delete;
gil_scoped_release &operator=(const gil_scoped_acquire &) = delete;
gil_scoped_release(const gil_scoped_release &) = delete;
gil_scoped_release &operator=(const gil_scoped_release &) = delete;

/// This method will disable the PyThreadState_DeleteCurrent call and the
/// GIL won't be acquired. This method should be used if the interpreter
Expand Down Expand Up @@ -203,7 +203,7 @@ class gil_scoped_release {
public:
gil_scoped_release() : state{PyEval_SaveThread()} {}
gil_scoped_release(const gil_scoped_release &) = delete;
gil_scoped_release &operator=(const gil_scoped_acquire &) = delete;
gil_scoped_release &operator=(const gil_scoped_release &) = delete;
~gil_scoped_release() { PyEval_RestoreThread(state); }
void disarm() {}
};
Expand All @@ -230,7 +230,7 @@ class gil_scoped_release {
(void) (this != (this + 1));
}
gil_scoped_release(const gil_scoped_release &) = delete;
gil_scoped_release &operator=(const gil_scoped_acquire &) = delete;
gil_scoped_release &operator=(const gil_scoped_release &) = delete;
void disarm() {}
};

Expand Down

0 comments on commit 08a89fa

Please sign in to comment.