diff options
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r-- | src/exiv2wrapper.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index 3cdc2d5..646abd9 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -753,7 +753,9 @@ const boost::python::list IptcTag::getRawValues() XmpTag::XmpTag(const std::string& key, Exiv2::Xmpdatum* datum): _key(key) { - if (datum != 0) + _from_datum = (datum != 0); + + if (_from_datum) { _datum = datum; } @@ -784,6 +786,14 @@ XmpTag::XmpTag(const std::string& key, Exiv2::Xmpdatum* datum): _key(key) } } +XmpTag::~XmpTag() +{ + if (!_from_datum) + { + delete _datum; + } +} + void XmpTag::setTextValue(const std::string& value) { _datum->setValue(value); |