diff options
-rw-r--r-- | src/libcamera/camera.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 0f45ab7e..617ea99c 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -358,24 +358,17 @@ std::shared_ptr<Camera> Camera::create(PipelineHandler *pipe, const std::string &name, const std::set<Stream *> &streams) { - struct Allocator : std::allocator<Camera> { - void construct(void *p, PipelineHandler *pipe, - const std::string &name) + struct Deleter : std::default_delete<Camera> { + void operator()(Camera *camera) { - ::new(p) Camera(pipe, name); - } - void destroy(Camera *p) - { - p->~Camera(); + delete camera; } }; - std::shared_ptr<Camera> camera = - std::allocate_shared<Camera>(Allocator(), pipe, name); - + Camera *camera = new Camera(pipe, name); camera->streams_ = streams; - return camera; + return std::shared_ptr<Camera>(camera, Deleter()); } /** |