aboutsummaryrefslogtreecommitdiffstats
path: root/router/router.h
diff options
context:
space:
mode:
Diffstat (limited to 'router/router.h')
-rw-r--r--router/router.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/router/router.h b/router/router.h
index 41060ecd..d2574e74 100644
--- a/router/router.h
+++ b/router/router.h
@@ -31,7 +31,7 @@
#define MAKE_ALC_VER(major, minor) (((major)<<8) | (minor))
-typedef struct DriverIface {
+struct DriverIface {
std::wstring Name;
HMODULE Module{nullptr};
int ALCVer{0};
@@ -133,7 +133,17 @@ typedef struct DriverIface {
LPALDOPPLERVELOCITY alDopplerVelocity{nullptr};
LPALSPEEDOFSOUND alSpeedOfSound{nullptr};
LPALDISTANCEMODEL alDistanceModel{nullptr};
-} DriverIface;
+
+ DriverIface(std::wstring name, HMODULE mod)
+ : Name(std::move(name)), Module(mod)
+ { }
+ ~DriverIface()
+ {
+ if(Module)
+ FreeLibrary(Module);
+ Module = nullptr;
+ }
+};
extern std::vector<DriverIface> DriverList;