From 4dd9386c4f04e1e45c1d377e9ac560d9ac0539e2 Mon Sep 17 00:00:00 2001 From: Sophie Kirschner Date: Fri, 24 Aug 2018 16:41:52 +0300 Subject: [PATCH 1/2] Fix error: member access into incomplete type 'SceneUtil::UnrefWorkItem' Fixes compile error encountered on OSX 10.9 with g++ sophie:build pineapple$ g++ --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix The compilation error: [ 24%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/mwrender/renderingmanager.cpp.o In file included from /Users/pineapple/git/openmw/apps/openmw/mwrender/renderingmanager.cpp:1: In file included from /Users/pineapple/git/openmw/apps/openmw/mwrender/renderingmanager.hpp:4: /Users/pineapple/git/openmw/openmw-deps/include/osg/ref_ptr:35:36: error: member access into incomplete type 'SceneUtil::UnrefWorkItem' ~ref_ptr() { if (_ptr) _ptr->unref(); _ptr = 0; } ^ /Users/pineapple/git/openmw/./components/sceneutil/unrefqueue.hpp:14:11: note: in instantiation of member function 'osg::ref_ptr::~ref_ptr' requested here class UnrefQueue : public osg::Referenced ^ /Users/pineapple/git/openmw/./components/sceneutil/unrefqueue.hpp:10:11: note: forward declaration of 'SceneUtil::UnrefWorkItem' class UnrefWorkItem; --- components/sceneutil/unrefqueue.cpp | 22 ++++++---------------- components/sceneutil/unrefqueue.hpp | 12 +++++++++++- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/components/sceneutil/unrefqueue.cpp b/components/sceneutil/unrefqueue.cpp index 42ea31133..271c17af2 100644 --- a/components/sceneutil/unrefqueue.cpp +++ b/components/sceneutil/unrefqueue.cpp @@ -1,28 +1,18 @@ #include "unrefqueue.hpp" -#include - //#include //#include -#include namespace SceneUtil { - - class UnrefWorkItem : public SceneUtil::WorkItem + void UnrefWorkItem::doWork() { - public: - std::deque > mObjects; - - virtual void doWork() - { - //osg::Timer timer; - //size_t objcount = mObjects.size(); - mObjects.clear(); - //Log(Debug::Verbose) << "cleared " << objcount << " objects in " << timer.time_m(); - } - }; + //osg::Timer timer; + //size_t objcount = mObjects.size(); + mObjects.clear(); + //Log(Debug::Verbose) << "cleared " << objcount << " objects in " << timer.time_m(); + } UnrefQueue::UnrefQueue() { diff --git a/components/sceneutil/unrefqueue.hpp b/components/sceneutil/unrefqueue.hpp index 4a2724927..7155e669c 100644 --- a/components/sceneutil/unrefqueue.hpp +++ b/components/sceneutil/unrefqueue.hpp @@ -1,13 +1,23 @@ #ifndef OPENMW_COMPONENTS_UNREFQUEUE_H #define OPENMW_COMPONENTS_UNREFQUEUE_H +#include + #include #include +#include + namespace SceneUtil { class WorkQueue; - class UnrefWorkItem; + + class UnrefWorkItem : public SceneUtil::WorkItem + { + public: + std::deque > mObjects; + virtual void doWork(); + }; /// @brief Handles unreferencing of objects through the WorkQueue. Typical use scenario /// would be the main thread pushing objects that are no longer needed, and the background thread deleting them. From c412f99963f03a4305271dfe00bfd03b500ba274 Mon Sep 17 00:00:00 2001 From: Sophie Kirschner Date: Sun, 26 Aug 2018 11:08:06 +0300 Subject: [PATCH 2/2] Remove commented lines in UnrefWorkItem::doWork --- components/sceneutil/unrefqueue.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/components/sceneutil/unrefqueue.cpp b/components/sceneutil/unrefqueue.cpp index 271c17af2..21ba836c0 100644 --- a/components/sceneutil/unrefqueue.cpp +++ b/components/sceneutil/unrefqueue.cpp @@ -8,10 +8,7 @@ namespace SceneUtil { void UnrefWorkItem::doWork() { - //osg::Timer timer; - //size_t objcount = mObjects.size(); mObjects.clear(); - //Log(Debug::Verbose) << "cleared " << objcount << " objects in " << timer.time_m(); } UnrefQueue::UnrefQueue()