Message ID | 20250325180821.1456154-2-barnabas.pocze@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
Quoting Barnabás Pőcze (2025-03-25 18:08:13) > A `Process` object has address identity because a pointer > to it is stored inside the `ProcessManager`. However, copy/move > special methods are still generated by the compiler. So disable > them to avoid potential issues and confusion. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > include/libcamera/internal/process.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/libcamera/internal/process.h b/include/libcamera/internal/process.h > index b1d07a5a5..58e3e41ce 100644 > --- a/include/libcamera/internal/process.h > +++ b/include/libcamera/internal/process.h > @@ -42,6 +42,8 @@ public: > Signal<enum ExitStatus, int> finished; > > private: > + LIBCAMERA_DISABLE_COPY_AND_MOVE(Process) > + > void closeAllFdsExcept(const std::vector<int> &fds); > int isolate(); > void died(int wstatus); > -- > 2.49.0 >
Hi Barnabás, Thank you for the patch. On Tue, Mar 25, 2025 at 07:08:13PM +0100, Barnabás Pőcze wrote: > A `Process` object has address identity because a pointer > to it is stored inside the `ProcessManager`. However, copy/move > special methods are still generated by the compiler. So disable > them to avoid potential issues and confusion. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > --- > include/libcamera/internal/process.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/libcamera/internal/process.h b/include/libcamera/internal/process.h > index b1d07a5a5..58e3e41ce 100644 > --- a/include/libcamera/internal/process.h > +++ b/include/libcamera/internal/process.h You should include libcamera/base/class.h. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > @@ -42,6 +42,8 @@ public: > Signal<enum ExitStatus, int> finished; > > private: > + LIBCAMERA_DISABLE_COPY_AND_MOVE(Process) > + > void closeAllFdsExcept(const std::vector<int> &fds); > int isolate(); > void died(int wstatus);
diff --git a/include/libcamera/internal/process.h b/include/libcamera/internal/process.h index b1d07a5a5..58e3e41ce 100644 --- a/include/libcamera/internal/process.h +++ b/include/libcamera/internal/process.h @@ -42,6 +42,8 @@ public: Signal<enum ExitStatus, int> finished; private: + LIBCAMERA_DISABLE_COPY_AND_MOVE(Process) + void closeAllFdsExcept(const std::vector<int> &fds); int isolate(); void died(int wstatus);
A `Process` object has address identity because a pointer to it is stored inside the `ProcessManager`. However, copy/move special methods are still generated by the compiler. So disable them to avoid potential issues and confusion. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- include/libcamera/internal/process.h | 2 ++ 1 file changed, 2 insertions(+)