X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Finput%2Flinux%2Fgamecontroller.cpp;h=2fc624e7b83db87e677c0c2bbe5fdda0fb0ccd53;hb=47e65794986e2b926448b3c7f99628eec40b6bb8;hp=8a4e8d43c2dbb3f06c9af66dd347dad721281f46;hpb=97ea3f88027c577811bcd9717ad506f254d393f5;p=libs%2Fgui.git diff --git a/source/input/linux/gamecontroller.cpp b/source/input/linux/gamecontroller.cpp index 8a4e8d4..2fc624e 100644 --- a/source/input/linux/gamecontroller.cpp +++ b/source/input/linux/gamecontroller.cpp @@ -12,10 +12,12 @@ namespace Msp { namespace Input { GameController::GameController(unsigned index): - priv(new Private), event_disp(0) { - priv->dev = new JsDevice(format("/dev/input/js%d", index)); + JsDevice *device = new JsDevice(format("/dev/input/js%d", index)); + + priv = new Private; + priv->dev = device; priv->dev->signal_data_available.connect(sigc::mem_fun(this, static_cast(&GameController::tick))); name = priv->dev->get_name(); tick(Time::zero);