[gnome-code-assistance] [backends/go] Fix not replying on exit
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-code-assistance] [backends/go] Fix not replying on exit
- Date: Fri, 15 Nov 2013 00:06:56 +0000 (UTC)
commit 35c0c0a1f0aa30b8832bff52017695c040709446
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Fri Nov 15 01:03:33 2013 +0100
[backends/go] Fix not replying on exit
backends/go/server_dbus.go | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/backends/go/server_dbus.go b/backends/go/server_dbus.go
index 26627ef..ba39ec7 100644
--- a/backends/go/server_dbus.go
+++ b/backends/go/server_dbus.go
@@ -235,7 +235,16 @@ func (s *ServerDbus) disposeApp(app *App) {
delete(s.apps, app.name)
if len(s.apps) == 0 {
- os.Exit(0)
+ // Do the final exit, but from a go routine so that we can
+ // block on something in go.dbus. Here we call ReleaseName
+ // which is a pretty valid thing to do just before exiting.
+ // This ensures that if we are currently still dispatching a
+ // method call, that this method call still returns before
+ // we exit (most likely Dispose)
+ go func() {
+ s.transport.conn.ReleaseName("org.gnome.CodeAssist.v1.go")
+ os.Exit(0)
+ }()
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]