mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-31 02:14:09 +03:00
Revert "Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free)"
This reverts commit 2f760af439.
This commit is contained in:
@@ -8,9 +8,6 @@ class MusicTrack
|
||||
public:
|
||||
MusicTrack(const char* fileName);
|
||||
MusicTrack(SDL_RWops *rw);
|
||||
MusicTrack(MusicTrack&& moved);
|
||||
MusicTrack& operator=(const MusicTrack& other) = default;
|
||||
~MusicTrack();
|
||||
Mix_Music *m_music;
|
||||
bool m_isValid;
|
||||
};
|
||||
@@ -19,12 +16,7 @@ class SoundTrack
|
||||
{
|
||||
public:
|
||||
SoundTrack(const char* fileName);
|
||||
SoundTrack(SoundTrack&& moved);
|
||||
SoundTrack& operator=(const SoundTrack& other) = default;
|
||||
SoundTrack() = default;
|
||||
~SoundTrack();
|
||||
Mix_Chunk *sound;
|
||||
bool isValid = false;
|
||||
};
|
||||
|
||||
class SoundSystem
|
||||
@@ -34,14 +26,4 @@ public:
|
||||
void playMusic(MusicTrack* music);
|
||||
};
|
||||
|
||||
// polyfill of std::move
|
||||
template<typename T> struct remove_reference {typedef T type;};
|
||||
template<typename T> struct remove_reference<T&> {typedef T type;};
|
||||
template<typename T> struct remove_reference<T&&> {typedef T type;};
|
||||
|
||||
template<typename T>
|
||||
typename remove_reference<T>::type&& move(T&& t) {
|
||||
return static_cast<typename remove_reference<T>::type&&>(t);
|
||||
}
|
||||
|
||||
#endif /* SOUNDSYSTEM_H */
|
||||
|
||||
Reference in New Issue
Block a user