]> git.tdb.fi Git - libs/gui.git/commitdiff
Close the game controller device when deleting the object
authorMikko Rasa <tdb@tdb.fi>
Sun, 20 Dec 2015 11:39:49 +0000 (13:39 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 20 Dec 2015 11:39:49 +0000 (13:39 +0200)
source/input/linux/gamecontroller.cpp
source/input/linux/gamecontroller_platform.h

index d5fed3baba92783c7e7e347bf0fd2fced4723100..7fc59ed6669d0f99f11758f352ac1a478550b570 100644 (file)
@@ -57,6 +57,11 @@ JsDevice::JsDevice(const string &fn)
                throw system_error(format("open(%s)", fn));
 }
 
+JsDevice::~JsDevice()
+{
+       sys_close(handle);
+}
+
 string JsDevice::get_name() const
 {
        char buf[128] = { 0 };
index 61bcdb5d67e90eda4e6d1bfe4bb2c7a9040ea815..517b1b099cc33e522aac398908fc50db9cf8b98a 100644 (file)
@@ -14,6 +14,7 @@ private:
 
 public:
        JsDevice(const std::string &);
+       ~JsDevice();
 
        std::string get_name() const;