From 5a3c309cd4025f207e3a77fe57021934e80de703 Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 22 Aug 2016 13:14:31 +0200 Subject: [PATCH] Make universe object destructors public for boost version 1.61 Fixes #887 The boost::serialization library changed the way objects are delete when deserializing referenced objects [boost::serialization 69ecae6] which was leading to a compile error. To work around this for the FreeOrion release 0.4.6 we decided to make the UniverseObject derived class destructors public. [boost::serialization]: https://github.com/boostorg/serialization/commit/69ecae6919b417be2b2558aefffea97fbe50d4a8 --- universe/Building.h | 7 +++++++ universe/Field.h | 7 +++++++ universe/Fleet.h | 7 +++++++ universe/Planet.h | 7 +++++++ universe/Ship.h | 7 +++++++ universe/System.h | 7 +++++++ 6 files changed, 42 insertions(+) diff --git a/universe/Building.h b/universe/Building.h index 5d21130..18d4810 100644 --- a/universe/Building.h +++ b/universe/Building.h @@ -68,7 +68,14 @@ class FO_COMMON_API Building : public UniverseObject { template friend void boost::python::detail::value_destroyer::execute(T const volatile* p); template friend void boost::checked_delete(T* x); + +#if BOOST_VERSION == 106100 +public: +#endif ~Building() {} +#if BOOST_VERSION == 106100 +protected: +#endif virtual Building* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Building //@} diff --git a/universe/Field.h b/universe/Field.h index 8cb5b9a..f1d454e 100644 --- a/universe/Field.h +++ b/universe/Field.h @@ -47,7 +47,14 @@ class FO_COMMON_API Field : public UniverseObject { template friend void boost::python::detail::value_destroyer::execute(T const volatile* p); template friend void boost::checked_delete(T* x); + +#if BOOST_VERSION == 106100 +public: +#endif ~Field() {} +#if BOOST_VERSION == 106100 +protected: +#endif virtual Field* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Field //@} diff --git a/universe/Fleet.h b/universe/Fleet.h index 923c2c7..a6a1fe0 100644 --- a/universe/Fleet.h +++ b/universe/Fleet.h @@ -149,7 +149,14 @@ class FO_COMMON_API Fleet : public UniverseObject { template friend void boost::python::detail::value_destroyer::execute(T const volatile* p); template friend void boost::checked_delete(T* x); + +#if BOOST_VERSION == 106100 +public: +#endif ~Fleet() {} +#if BOOST_VERSION == 106100 +protected: +#endif virtual Fleet* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Fleet //@} diff --git a/universe/Planet.h b/universe/Planet.h index ec4a6c3..44289ef 100644 --- a/universe/Planet.h +++ b/universe/Planet.h @@ -183,7 +183,14 @@ class FO_COMMON_API Planet : template friend void boost::python::detail::value_destroyer::execute(T const volatile* p); template friend void boost::checked_delete(T* x); + +#if BOOST_VERSION == 106100 +public: +#endif ~Planet() {} +#if BOOST_VERSION == 106100 +protected: +#endif virtual Planet* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Planet //@} diff --git a/universe/Ship.h b/universe/Ship.h index aa71038..4881086 100644 --- a/universe/Ship.h +++ b/universe/Ship.h @@ -103,7 +103,14 @@ class FO_COMMON_API Ship : public UniverseObject { template friend void boost::python::detail::value_destroyer::execute(T const volatile* p); template friend void boost::checked_delete(T* x); + +#if BOOST_VERSION == 106100 +public: +#endif ~Ship() {} +#if BOOST_VERSION == 106100 +protected: +#endif virtual Ship* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Ship //@} diff --git a/universe/System.h b/universe/System.h index 0740720..5ecb684 100644 --- a/universe/System.h +++ b/universe/System.h @@ -132,7 +132,14 @@ class FO_COMMON_API System : public UniverseObject { template friend void boost::python::detail::value_destroyer::execute(T const volatile* p); template friend void boost::checked_delete(T* x); + +#if BOOST_VERSION == 106100 +public: +#endif ~System() {} +#if BOOST_VERSION == 106100 +protected: +#endif virtual System* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this System //@}