From 325ac475c51dc0d54503f725179ea2d9353485bb Mon Sep 17 00:00:00 2001 From: James Dong Date: Mon, 27 Apr 2009 12:01:59 -0700 Subject: Bug fix(1807910): media recorder crash due to the use of locked camera object (last part) - remove an unused Camera constructor - add a check on the argument in Camera::create() method --- libs/ui/Camera.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'libs/ui') diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp index 0fba82c..41577c4 100644 --- a/libs/ui/Camera.cpp +++ b/libs/ui/Camera.cpp @@ -64,22 +64,16 @@ Camera::Camera() init(); } -Camera::Camera(const sp& camera) -{ - init(); - // connect this client to existing camera remote - if (camera->connect(this) == NO_ERROR) { - mStatus = NO_ERROR; - mCamera = camera; - camera->asBinder()->linkToDeath(this); - } -} - - +// construct a camera client from an existing camera remote sp Camera::create(const sp& camera) { + LOGV("create"); + if (camera == 0) { + LOGE("camera remote is a NULL pointer"); + return 0; + } + sp c = new Camera(); - // connect this client to existing camera remote if (camera->connect(c) == NO_ERROR) { c->mStatus = NO_ERROR; c->mCamera = camera; -- cgit v1.1