diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-03 22:55:11 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-07 18:10:31 +0300 |
commit | ba3a1adc13b9a2c2e92f438bcf5320d77bd08bd9 (patch) | |
tree | d45905b8d2703541bdb09a7dcd5ea32e0d7c4924 /test/ipa/ipa_interface_test.cpp | |
parent | 5a867f312c0f8d91cc38f17915326e2e56adac14 (diff) |
libcamera: pipeline_handler: Return unique_ptr from createInstance
Avoid naked pointer with memory allocation by returning a unique_ptr
from PipelineHandlerFactory::createInstance(), in order to increase
memory allocation safety.
This allows iterating over factories in the CameraManager and unit tests
using const pointers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'test/ipa/ipa_interface_test.cpp')
-rw-r--r-- | test/ipa/ipa_interface_test.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp index 3c0df843..a629abc2 100644 --- a/test/ipa/ipa_interface_test.cpp +++ b/test/ipa/ipa_interface_test.cpp @@ -52,9 +52,9 @@ protected: ipaManager_ = make_unique<IPAManager>(); /* Create a pipeline handler for vimc. */ - std::vector<PipelineHandlerFactory *> &factories = + const std::vector<PipelineHandlerFactory *> &factories = PipelineHandlerFactory::factories(); - for (PipelineHandlerFactory *factory : factories) { + for (const PipelineHandlerFactory *factory : factories) { if (factory->name() == "PipelineHandlerVimc") { pipe_ = factory->create(nullptr); break; |