OSDN Git Service

modules: camera: make Metadata a delete-able object
authorAlex Ray <aray@google.com>
Fri, 31 May 2013 23:51:39 +0000 (16:51 -0700)
committerAlex Ray <aray@google.com>
Wed, 3 Jul 2013 21:32:59 +0000 (14:32 -0700)
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

modules/camera/Metadata.cpp

index 362a087..b26986d 100644 (file)
@@ -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)