summaryrefslogtreecommitdiff
path: root/src/audiofile.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-07 13:01:34 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-07 13:01:34 +0200
commit331be8dc452bf47705556d2a7f7f5988973930ca (patch)
tree164a30fd5cef68a39713315085da8bd7901a1d07 /src/audiofile.cc
parent064f0112bd825f1102a94e109e5329710d59eb82 (diff)
Fixed crashbug on drumkit reload.
Diffstat (limited to 'src/audiofile.cc')
-rw-r--r--src/audiofile.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/audiofile.cc b/src/audiofile.cc
index 3f0bd82..5a9cdb5 100644
--- a/src/audiofile.cc
+++ b/src/audiofile.cc
@@ -42,15 +42,23 @@ AudioFile::AudioFile(std::string filename)
data = NULL;
size = 0;
+ magic = this;
+
//load();
}
AudioFile::~AudioFile()
{
+ magic = NULL;
//printf("delete AudioFile %p\n", this);
unload();
}
+bool AudioFile::isValid()
+{
+ return this == magic;
+}
+
void AudioFile::unload()
{
if(data) {