diff options
author | Tulir Asokan <tulir@maunium.net> | 2019-06-15 01:11:51 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2019-06-15 01:11:54 +0300 |
commit | a55ea42d7f5900bd5fc8fad047040c7865824f33 (patch) | |
tree | 2b5ee3f3087751471903a21e99ca7a68fc97b928 /gomuks.go | |
parent | a4ac699c930e783175b6451a5becd7b70835aefb (diff) |
Unbreak things
Diffstat (limited to 'gomuks.go')
-rw-r--r-- | gomuks.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -81,13 +81,15 @@ func (gmx *Gomuks) StartAutosave() { // Stop stops the Matrix syncer, the tview app and the autosave goroutine, // then saves everything and calls os.Exit(0). -func (gmx *Gomuks) Stop() { +func (gmx *Gomuks) Stop(save bool) { debug.Print("Disconnecting from Matrix...") gmx.matrix.Stop() debug.Print("Cleaning up UI...") gmx.ui.Stop() gmx.stop <- true - gmx.Save() + if save { + gmx.Save() + } os.Exit(0) } @@ -102,7 +104,7 @@ func (gmx *Gomuks) Start() { signal.Notify(c, os.Interrupt, syscall.SIGTERM) go func() { <-c - gmx.Stop() + gmx.Stop(true) }() go gmx.StartAutosave() |