From c8bad6b5dc272b3285e40ece1f6500bcd17b3d78 Mon Sep 17 00:00:00 2001 From: Dmitrij Naumov <dmitrij@naumov.de> Date: Fri, 12 Sep 2014 22:16:23 +0200 Subject: [PATCH] [A] Use non-static member init for ProjectData::geoObjects. This removes ProjectData ctor; --- Applications/ProjectData.cpp | 16 ---------------- Applications/ProjectData.h | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/Applications/ProjectData.cpp b/Applications/ProjectData.cpp index 0c74e358fe0..55c53338084 100644 --- a/Applications/ProjectData.cpp +++ b/Applications/ProjectData.cpp @@ -36,24 +36,8 @@ void readGeometry(std::string const& fname, GeoLib::GEOObjects & geo_objects) } -ProjectData::ProjectData() -: -#ifdef OGS_BUILD_GUI - _geoObjects(new GEOModels()) -#else - _geoObjects(new GeoLib::GEOObjects()) -#endif -{ -} - ProjectData::ProjectData(ConfigTree const& project_config, std::string const& path) -: -#ifdef OGS_BUILD_GUI - _geoObjects(new GEOModels()) -#else - _geoObjects(new GeoLib::GEOObjects()) -#endif { // geometry std::string const geometry_file = BaseLib::copyPathToFileName( diff --git a/Applications/ProjectData.h b/Applications/ProjectData.h index c0a8ba484aa..2f95070d3cc 100644 --- a/Applications/ProjectData.h +++ b/Applications/ProjectData.h @@ -41,7 +41,7 @@ using ConfigTree = boost::property_tree::ptree; public: /// The empty constructor used in the gui, for example, when the project's /// configuration is not loaded yet. - ProjectData(); + ProjectData() = default; /// Constructs project data by parsing provided configuration. /// The additional path is used to find files referenced in the @@ -106,9 +106,9 @@ private: private: #ifdef OGS_BUILD_GUI - GEOModels *_geoObjects; + GEOModels *_geoObjects = new GEOModels(); #else - GeoLib::GEOObjects *_geoObjects; + GeoLib::GEOObjects *_geoObjects = new GeoLib::GEOObjects(); #endif std::vector<MeshLib::Mesh*> _mesh_vec; std::vector<ProcessLib::Process*> _processes; -- GitLab