summaryrefslogtreecommitdiff
path: root/src/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-21 22:33:43 +0200
committerCarl Hetherington <cth@carlh.net>2020-09-22 00:06:21 +0200
commite40f5c5923d72b42d7b1c617a6e459569d584e8c (patch)
tree4b87b267ea7e4a16f7b49464fd79d1473944fbd9 /src/util.cc
parentb301ef78906ed61eced5d0a331b377b644ae647c (diff)
Fix crashes when static linking due to tricky lifetimecrash
management of ASDCP::DefaultSMPTEDict().
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util.cc b/src/util.cc
index c7d090ea..009d5bae 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -76,6 +76,13 @@ using boost::function;
using boost::algorithm::trim;
using namespace dcp;
+
+/* Some ASDCP objects store this as a *&, for reasons which are not
+ * at all clear, so we have to keep this around forever.
+ */
+ASDCP::Dictionary const* dcp::asdcp_smpte_dict = 0;
+
+
/** Create a UUID.
* @return UUID.
*/
@@ -164,7 +171,7 @@ dcp::empty_or_white_space (string s)
return true;
}
-/** Set up various bits that the library needs. Should be called one
+/** Set up various bits that the library needs. Should be called once
* by client applications.
*/
void
@@ -189,6 +196,8 @@ dcp::init ()
}
OpenSSL_add_all_algorithms();
+
+ asdcp_smpte_dict = &ASDCP::DefaultSMPTEDict();
}
/** Decode a base64 string. The base64 decode routine in KM_util.cpp