Merged pull request #1887

pull/541/head
Marc Zinnschlag 6 years ago
commit 232ea4f793

@ -1,28 +1,15 @@
#include "unrefqueue.hpp"
#include <deque>
//#include <osg/Timer>
//#include <components/debug/debuglog.hpp>
#include <components/sceneutil/workqueue.hpp>
namespace SceneUtil
{
class UnrefWorkItem : public SceneUtil::WorkItem
void UnrefWorkItem::doWork()
{
public:
std::deque<osg::ref_ptr<const osg::Referenced> > mObjects;
virtual void doWork()
{
//osg::Timer timer;
//size_t objcount = mObjects.size();
mObjects.clear();
//Log(Debug::Verbose) << "cleared " << objcount << " objects in " << timer.time_m();
}
};
mObjects.clear();
}
UnrefQueue::UnrefQueue()
{

@ -1,13 +1,23 @@
#ifndef OPENMW_COMPONENTS_UNREFQUEUE_H
#define OPENMW_COMPONENTS_UNREFQUEUE_H
#include <deque>
#include <osg/ref_ptr>
#include <osg/Referenced>
#include <components/sceneutil/workqueue.hpp>
namespace SceneUtil
{
class WorkQueue;
class UnrefWorkItem;
class UnrefWorkItem : public SceneUtil::WorkItem
{
public:
std::deque<osg::ref_ptr<const osg::Referenced> > 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.

Loading…
Cancel
Save