diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-08-07 23:03:02 +0300 |
---|---|---|
committer | Daniel Stone <daniels@endtroducing.fooishbar.org> | 2006-08-07 23:03:02 +0300 |
commit | 7721ee308fbbb6fc9c969f15fe04b3346c04f843 (patch) | |
tree | 0c7a3e3147b09562c98c94702952c6dbfa1fd21f /config/config.c | |
parent | 458c63a84110f64c7fce397a531a3a779c2239a2 (diff) |
config client: fix minor race with event queue
Fix a small race whereby you could remove a device while events from it
were still in the queue, by calling ProcessInputEvents immediately before
RemoveDevice, to (hopefully) flush the event queue.
Diffstat (limited to 'config/config.c')
-rw-r--r-- | config/config.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/config.c b/config/config.c index b85b12028..d4cf23334 100644 --- a/config/config.c +++ b/config/config.c @@ -173,6 +173,10 @@ configMessage(DBusConnection *connection, DBusMessage *message, void *closure) return DBUS_HANDLER_RESULT_HANDLED; } ErrorF("pDev is %p\n", pDev); + /* Call PIE here so we don't try to dereference a device that's + * already been removed. Technically there's still a small race + * here, so we should ensure that SIGIO is blocked. */ + ProcessInputEvents(); RemoveDevice(pDev); dbus_error_free(&error); return DBUS_HANDLER_RESULT_HANDLED; |