From 60c07599cd3ea8a5befbb3ce5e1e7837b875f2d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Sat, 18 Jan 2014 11:13:58 +0100
Subject: Sluift: Ensure all events have been processed before disconnecting

This avoids errors when disconnecting the client while there are still
elements waiting.

Change-Id: I005ec3f14c138b76f6381f1a89b3ee250a40777f

diff --git a/Sluift/client.cpp b/Sluift/client.cpp
index 1a64eea..914ab9c 100644
--- a/Sluift/client.cpp
+++ b/Sluift/client.cpp
@@ -112,6 +112,7 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
 		"self\n",
 		""
 ) {
+	Sluift::globals.eventLoop.runOnce();
 	getClient(L)->disconnect();
 	return 0;
 }
-- 
cgit v0.10.2-6-g49f6