aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-05-17 19:32:45 +0200
committerOlivier Tilloy <olivier@tilloy.net>2010-05-17 19:32:45 +0200
commit705f86b3d71160c90920bc665a9bbb2b8daf392c (patch)
tree02335e6edc0dc280689216b80fc61a5f62e30ae0 /src/exiv2wrapper.cpp
parent65e13aae83c40b5e040b59ac40415b4f97d24bb1 (diff)
downloadpyexiv2-705f86b3d71160c90920bc665a9bbb2b8daf392c.tar.gz
Free the allocated memory when deleting an IptcTag.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index de53b94..3cdc2d5 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -633,7 +633,9 @@ const std::string ExifTag::getHumanValue()
IptcTag::IptcTag(const std::string& key, Exiv2::IptcMetadata* data): _key(key)
{
- if (data != 0)
+ _from_data = (data != 0);
+
+ if (_from_data)
{
_data = data;
}
@@ -664,6 +666,14 @@ IptcTag::IptcTag(const std::string& key, Exiv2::IptcMetadata* data): _key(key)
}
}
+IptcTag::~IptcTag()
+{
+ if (!_from_data)
+ {
+ delete _data;
+ }
+}
+
void IptcTag::setRawValues(const boost::python::list& values)
{
if (!_repeatable && (boost::python::len(values) > 1))