From: Stephen Morris Date: Thu, 17 Sep 2015 15:33:08 +0000 (+0100) Subject: [4046] Fix missing message_dictionary.h in install directory X-Git-Tag: trac4074_base~13^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb6ec86ee22264523aa26533af2db259231dd325;p=thirdparty%2Fkea.git [4046] Fix missing message_dictionary.h in install directory This file was included in message_initializer.h; as that was copied to the install directory, this one needed to be as well (but wasn't). Since MessageInitializer only contains a pointer to the message dictionary, providing a standalone declaration of MessageDictionary in that file eliminated the need to include the definition in message_dictionary.h, so the #include of that file could be removed and with it the need to copy it to the installation directory. --- diff --git a/src/lib/log/message_initializer.h b/src/lib/log/message_initializer.h index a26e3f107c..dbd2f24ba4 100644 --- a/src/lib/log/message_initializer.h +++ b/src/lib/log/message_initializer.h @@ -15,7 +15,6 @@ #ifndef MESSAGEINITIALIZER_H #define MESSAGEINITIALIZER_H -#include #include #include #include @@ -25,6 +24,9 @@ namespace isc { namespace log { +// Declare the MessageDictionary class to allow a pointer to it to be defined. +class MessageDictionary; + /// @name Type definitions for containers shared among instances of the class. /// //\{ @@ -143,13 +145,13 @@ private: /// \brief Holds the pointer to the global dictionary. /// - /// The \c MessageInitializer instantiates the global dictionary and - /// keeps the reference to it throughout its lifetime as the global - /// dictionary is instantiated in the destructor. If the reference is - /// not held then it is possible that the global dictionary is destroyed - /// before the \c MessageInitializer destructor is called, causing the - /// static initialization order fiasco. - MessageDictionaryPtr global_dictionary_; + /// One or more instances of \c MessageInitalizer are created statically, + /// the \c MessageDictionary being created by the first one to run. As the + /// \c MessageDictionary is also accessed by the \c MessageInitializer + /// destructor, a smart pointer to it is kept. This avoids the possibility + /// that, during shutdown, the \c MessageDictionary is destroyed before all + /// instances of \c MessageInitializer. + boost::shared_ptr global_dictionary_; /// \brief Holds the shared pointer to the list of pointers to the /// log messages defined by various instances of this class.