unique_ptr'ing things and removing some XECLEANUP.

This commit is contained in:
Ben Vanik
2014-08-20 23:26:46 -07:00
parent 244e8a8745
commit c59d053404
43 changed files with 271 additions and 347 deletions

View File

@@ -11,34 +11,30 @@
#include <xenia/apu/nop/nop_audio_system.h>
using namespace xe;
using namespace xe::apu;
using namespace xe::apu::nop;
namespace {
void InitializeIfNeeded();
void CleanupOnShutdown();
void InitializeIfNeeded();
void CleanupOnShutdown();
void InitializeIfNeeded() {
static bool has_initialized = false;
if (has_initialized) {
return;
}
has_initialized = true;
//
atexit(CleanupOnShutdown);
void InitializeIfNeeded() {
static bool has_initialized = false;
if (has_initialized) {
return;
}
has_initialized = true;
void CleanupOnShutdown() {
}
//
atexit(CleanupOnShutdown);
}
void CleanupOnShutdown() {}
}
AudioSystem* xe::apu::nop::Create(Emulator* emulator) {
std::unique_ptr<AudioSystem> xe::apu::nop::Create(Emulator* emulator) {
InitializeIfNeeded();
return new NopAudioSystem(emulator);
return std::make_unique<NopAudioSystem>(emulator);
}

View File

@@ -10,6 +10,8 @@
#ifndef XENIA_APU_NOP_NOP_APU_H_
#define XENIA_APU_NOP_NOP_APU_H_
#include <memory>
#include <xenia/core.h>
namespace xe {
@@ -21,7 +23,7 @@ namespace apu {
class AudioSystem;
namespace nop {
AudioSystem* Create(Emulator* emulator);
std::unique_ptr<AudioSystem> Create(Emulator* emulator);
} // namespace nop
} // namespace apu