Browse Source

Opening a browser happens in it's own routine (fixes #1273)

Audrius Butkevicius 10 năm trước cách đây
mục cha
commit
ba8cadc2f1
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      cmd/syncthing/main.go

+ 3 - 1
cmd/syncthing/main.go

@@ -658,7 +658,9 @@ func setupGUI(cfg *config.Wrapper, m *model.Model) {
 			}
 			if opts.StartBrowser && !noBrowser && !stRestarting {
 				urlOpen := fmt.Sprintf("%s://%s/", proto, net.JoinHostPort(hostOpen, strconv.Itoa(addr.Port)))
-				openURL(urlOpen)
+				// Can potentially block if the utility we are invoking doesn't
+				// fork, and just execs, hence keep it in it's own routine.
+				go openURL(urlOpen)
 			}
 		}
 	}