unique_ptr'ing things and removing some XECLEANUP.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user