diff options
-rw-r--r-- | simple-cam.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/simple-cam.cpp b/simple-cam.cpp index 8f7012b..5c16db6 100644 --- a/simple-cam.cpp +++ b/simple-cam.cpp @@ -131,8 +131,15 @@ int main() * * The CameraManager provides a list of available Cameras that * applications can operate on. + * + * When the CameraManager is no longer to be used, it should be deleted. + * We use a unique_ptr here to manage the lifetime automatically during + * the scope of this function. + * + * There can only be a single CameraManager constructed within any + * process space. */ - CameraManager *cm = new CameraManager(); + std::unique_ptr<CameraManager> cm = std::make_unique<CameraManager>(); cm->start(); /* |