From b14d706a72c706c9c59dbdf64a9e41f32465e060 Mon Sep 17 00:00:00 2001 From: jhurst Date: Tue, 13 Apr 2021 15:50:50 -0700 Subject: o Added a Clone() method to InterchangeObject and derivatives that allows making a descriptor copy that is not owned by any other strucure. The caller must arrange to delete the object pointer returned. o While implementing the above it became obvious that the reference-to-a-pointer-to-the-dictionary idiom that is used throughout the lower levels of the MXF library was the cause of much more grief than it was originally designed to prevent. This was made even more obvious when I replaced all of it with simple pointers, which revealed several shadow instances of m_Dict that were only reliable while the object that held them was valid. --- src/h__Writer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/h__Writer.cpp') diff --git a/src/h__Writer.cpp b/src/h__Writer.cpp index 0c56b4c..f6d49b6 100755 --- a/src/h__Writer.cpp +++ b/src/h__Writer.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2004-2018, John Hurst +Copyright (c) 2004-2021, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ ASDCP::derive_timecode_rate_from_edit_rate(const ASDCP::Rational& edit_rate) // add DMS CryptographicFramework entry to source package void ASDCP::AddDmsCrypt(Partition& HeaderPart, SourcePackage& Package, - WriterInfo& Descr, const UL& WrappingUL, const Dictionary*& Dict) + WriterInfo& Descr, const UL& WrappingUL, const Dictionary* Dict) { assert(Dict); // Essence Track @@ -102,7 +102,7 @@ id_batch_contains(const Array& batch, const Kumu::UUID& value) // Result_t ASDCP::AddDmsTrackGenericPartUtf8Text(Kumu::FileWriter& file_writer, MXF::OP1aHeader& header_part, - SourcePackage& source_package, MXF::RIP& rip, const Dictionary*& Dict) + SourcePackage& source_package, MXF::RIP& rip, const Dictionary* Dict) { Sequence* Sequence_obj = 0; InterchangeObject* tmp_iobj = 0; @@ -213,8 +213,8 @@ ASDCP::AddDmsTrackGenericPartUtf8Text(Kumu::FileWriter& file_writer, MXF::OP1aHe } // -ASDCP::h__ASDCPWriter::h__ASDCPWriter(const Dictionary& d) : - MXF::TrackFileWriter(d), m_BodyPart(m_Dict), m_FooterPart(m_Dict) {} +ASDCP::h__ASDCPWriter::h__ASDCPWriter(const Dictionary* d) : + MXF::TrackFileWriter(d), m_BodyPart(d), m_FooterPart(d) {} ASDCP::h__ASDCPWriter::~h__ASDCPWriter() {} -- cgit v1.2.3