- atempt to cleanup use fo auto_ptr

This commit is contained in:
SoftCoder
2016-01-18 13:20:49 -08:00
parent d82aaa22ad
commit 86a59859b9
16 changed files with 76 additions and 50 deletions

View File

@@ -0,0 +1,27 @@
// ==============================================================
// This file is part of Glest Shared Library (www.glest.org)
//
// Copyright (C) 2005 Matthias Braun <matze@braunis.de>
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
#ifndef _COMMON_SCOPED_PTR_H_
#define _COMMON_SCOPED_PTR_H_
#include <memory>
// =====================================================
// class Thread
// =====================================================
using namespace std;
#if !defined(HAVE_CXX11) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
#define unique_ptr auto_ptr
#endif
#endif

View File

@@ -19,6 +19,7 @@
#include <SDL_mutex.h>
#include <string>
#include <memory>
#include "common_scoped_ptr.h"
#include "data_types.h"
#ifdef DEBUG_PERFORMANCE_MUTEXES
@@ -69,7 +70,7 @@ public:
private:
SDL_Thread* thread;
//std::auto_ptr<Mutex> mutexthreadAccessor;
//std::unique_ptr<Mutex> mutexthreadAccessor;
Mutex *mutexthreadAccessor;
ThreadState currentState;
bool threadObjectValid();
@@ -128,7 +129,7 @@ private:
Shared::PlatformCommon::Chrono *chronoPerf;
bool isStaticMutexListMutex;
static auto_ptr<Mutex> mutexMutexList;
static unique_ptr<Mutex> mutexMutexList;
static vector<Mutex *> mutexList;
public: