call acn.Close so tor proceess is shut down
This commit is contained in:
parent
7609cc3d04
commit
a692a996ac
19
main.go
19
main.go
|
@ -56,8 +56,14 @@ func main() {
|
|||
// this actually loads the qml
|
||||
view.SetSource(qmlSource)
|
||||
|
||||
acn, err := connectivity.StartTor(the.CwtchDir, "")
|
||||
if err != nil {
|
||||
log.Errorf("Could not start Tor: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// these are long-lived pollers/listeners for incoming messages and status changes
|
||||
loadCwtchData(gcd)
|
||||
loadCwtchData(gcd, acn)
|
||||
go characters.IncomingListener(gcd.UIState.AddMessage)
|
||||
go characters.PostmanPat(gcd.OutgoingMessages)
|
||||
go characters.TorStatusPoller(gcd.TorStatus)
|
||||
|
@ -83,6 +89,7 @@ func main() {
|
|||
// here we go!
|
||||
view.Show()
|
||||
widgets.QApplication_Exec()
|
||||
acn.Close()
|
||||
}
|
||||
|
||||
// window construction boilerplate
|
||||
|
@ -101,7 +108,7 @@ func initializeQtView() *quick.QQuickView {
|
|||
|
||||
// this is mostly going to get factored out when we add profile support
|
||||
// for now, it loads a single peer and fills the ui with its data
|
||||
func loadCwtchData(gcd *gothings.GrandCentralDispatcher) {
|
||||
func loadCwtchData(gcd *gothings.GrandCentralDispatcher, acn connectivity.ACN) {
|
||||
var err error
|
||||
if os.Getenv("CWTCH_FOLDER") != "" {
|
||||
the.CwtchDir = os.Getenv("CWTCH_FOLDER")
|
||||
|
@ -122,13 +129,7 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) {
|
|||
*/
|
||||
os.MkdirAll(the.CwtchDir, 0700)
|
||||
|
||||
mn, err := connectivity.StartTor(the.CwtchDir, "")
|
||||
if err != nil {
|
||||
log.Errorf("Could not start Tor: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
the.CwtchApp = libapp.NewApp(mn, the.CwtchDir)
|
||||
the.CwtchApp = libapp.NewApp(acn, the.CwtchDir)
|
||||
|
||||
err = the.CwtchApp.LoadProfiles("be gay do crime")
|
||||
if err != nil {
|
||||
|
|
Reference in New Issue