Skip to content

Commit 352db0c

Browse files
jbleyelfairbird
authored andcommitted
"[eInputDeviceInit]" don't add input device if already exists
1 parent 29375ab commit 352db0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/driver/rcinput.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ class eInputDeviceInit
188188

189189
void add(const char* filename)
190190
{
191+
for (itemlist::iterator it = items.begin(); it != items.end(); ++it)
192+
{
193+
if (strcmp((*it)->filename, filename) == 0)
194+
{
195+
// Ignore if already exists
196+
return;
197+
}
198+
}
191199
eDebug("[eInputDeviceInit] adding device %s", filename);
192200
eRCInputEventDriver *p = new eRCInputEventDriver(filename);
193201
items.push_back(new element(filename, p, new eRCDeviceInputDev(p, consoleFd)));

0 commit comments

Comments
 (0)