unique_ptr'ing things and removing some XECLEANUP.
This commit is contained in:
@@ -11,34 +11,30 @@
|
||||
|
||||
#include <xenia/apu/xaudio2/xaudio2_audio_system.h>
|
||||
|
||||
|
||||
using namespace xe;
|
||||
using namespace xe::apu;
|
||||
using namespace xe::apu::xaudio2;
|
||||
|
||||
|
||||
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::xaudio2::Create(Emulator* emulator) {
|
||||
std::unique_ptr<AudioSystem> xe::apu::xaudio2::Create(Emulator* emulator) {
|
||||
InitializeIfNeeded();
|
||||
return new XAudio2AudioSystem(emulator);
|
||||
return std::make_unique<XAudio2AudioSystem>(emulator);
|
||||
}
|
||||
|
||||
@@ -10,24 +10,23 @@
|
||||
#ifndef XENIA_APU_XAUDIO2_XAUDIO2_APU_H_
|
||||
#define XENIA_APU_XAUDIO2_XAUDIO2_APU_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <xenia/core.h>
|
||||
|
||||
|
||||
XEDECLARECLASS1(xe, Emulator);
|
||||
XEDECLARECLASS2(xe, apu, AudioSystem);
|
||||
|
||||
namespace xe {
|
||||
class Emulator;
|
||||
} // namespace xe
|
||||
|
||||
namespace xe {
|
||||
namespace apu {
|
||||
class AudioSystem;
|
||||
namespace xaudio2 {
|
||||
|
||||
|
||||
AudioSystem* Create(Emulator* emulator);
|
||||
|
||||
std::unique_ptr<AudioSystem> Create(Emulator* emulator);
|
||||
|
||||
} // namespace xaudio2
|
||||
} // namespace apu
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_APU_XAUDIO2_XAUDIO2_APU_H_
|
||||
|
||||
Reference in New Issue
Block a user