From f2b47b88f70990bf76fe83d45b64477b4db4dffc Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 27 Aug 2013 16:26:06 +0200 Subject: test-client.py: flush GDBusConnection before (potentially) freeing it --- test/test-client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/test-client.py b/test/test-client.py index a1d503f..0dbf868 100755 --- a/test/test-client.py +++ b/test/test-client.py @@ -63,6 +63,11 @@ class MessagingMenuTest(dbusmock.DBusTestCase): self.assertMethodCalled('UnregisterApplication', 'test.desktop') # ApplicationStoppedRunning is called when the last ref on mmapp is dropped + # Since mmapp is the only thing holding on to a GDBusConnection, the + # connection might get freed before it sends the StoppedRunning + # message. Flush the connection to make sure it is sent. + bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) + bus.flush_sync(None) del mmapp self.assertMethodCalled('ApplicationStoppedRunning', 'test.desktop') -- cgit v1.2.3