X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdevice.cpp;h=aea089790ca51251dc4acd3407a0e78880ece1d7;hb=2a685e572e2ab8d9f50129de3f0869628edb3d8e;hp=422b7ea2f8e055970c6ba9d6d9297c60a0f95e58;hpb=35ea5cc8d1eb8c806885d27441548f630e7b1266;p=libs%2Fal.git diff --git a/source/device.cpp b/source/device.cpp index 422b7ea..aea0897 100644 --- a/source/device.cpp +++ b/source/device.cpp @@ -2,7 +2,7 @@ This file is part of libmspal Copyright © 2008 Mikko Rasa, Mikkosoft Productions -Diestributed under the LGPL +Distributed under the LGPL */ #include @@ -15,17 +15,22 @@ namespace AL { Device::Device() { - dev=alcOpenDevice(0); + dev = alcOpenDevice(0); if(!dev) throw Exception("Couldn't get OpenAL device"); } Device::Device(const string &spec) { - dev=alcOpenDevice(spec.c_str()); + dev = alcOpenDevice(spec.c_str()); if(!dev) throw Exception("Couldn't get OpenAL device"); } +Device::~Device() +{ + alcCloseDevice(dev); +} + } // namespace AL } // namespace Msp