summaryrefslogtreecommitdiffstats
path: root/modules/camera
diff options
context:
space:
mode:
authorAlex Ray <aray@google.com>2013-05-31 16:51:39 -0700
committerAlex Ray <aray@google.com>2013-07-03 14:32:59 -0700
commit90c0af71f67ea99da34f67f4739a8687247e01b7 (patch)
treed3eef7c6d1e5d6a929f1140bc143c538313609f7 /modules/camera
parent77ecfd76d79ba3e864ee8cea331e6fac41a1ea45 (diff)
downloadhardware_libhardware-90c0af71f67ea99da34f67f4739a8687247e01b7.zip
hardware_libhardware-90c0af71f67ea99da34f67f4739a8687247e01b7.tar.gz
hardware_libhardware-90c0af71f67ea99da34f67f4739a8687247e01b7.tar.bz2
modules: camera: make Metadata a delete-able object
Metadata is currently only used for immutable persistent settings (static camera characteristics, and the capture templates), but will be used for dynamic metadata as well. Make it deleteable so we can create/destroy these at will. Change-Id: I7372b07b904d5a6b55453093712e0bb2675918b5
Diffstat (limited to 'modules/camera')
-rw-r--r--modules/camera/Metadata.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/camera/Metadata.cpp b/modules/camera/Metadata.cpp
index 362a087..b26986d 100644
--- a/modules/camera/Metadata.cpp
+++ b/modules/camera/Metadata.cpp
@@ -43,8 +43,18 @@ Metadata::Metadata()
Metadata::~Metadata()
{
+ Entry *current = mHead;
+
+ while (current != NULL) {
+ Entry *tmp = current;
+ current = current->mNext;
+ delete tmp;
+ }
+
if (mGenerated != NULL)
free_camera_metadata(mGenerated);
+
+ pthread_mutex_destroy(&mMutex);
}
Metadata::Metadata(uint8_t mode, uint8_t intent)