X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Flinux%2Fgamecontroller.cpp;h=7fc59ed6669d0f99f11758f352ac1a478550b570;hb=d17c22c1da1915afbcb9e39f4bd5e7e28259a110;hp=bf690494a91c76d08d71f10d2ad8a425cf56a2a8;hpb=051149e5026ff64f3ec477cf19080124b82de619;p=libs%2Fgui.git diff --git a/source/input/linux/gamecontroller.cpp b/source/input/linux/gamecontroller.cpp index bf69049..7fc59ed 100644 --- a/source/input/linux/gamecontroller.cpp +++ b/source/input/linux/gamecontroller.cpp @@ -57,9 +57,14 @@ 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]; + char buf[128] = { 0 }; int ret = ioctl(*handle, JSIOCGNAME(sizeof(buf)), buf); if(ret<0) throw system_error("ioctl(JSIOCGNAME)");