Fix an issue where initialization may not have been performed

This commit is contained in:
akiyosi 2024-09-01 21:16:22 +09:00
parent 1a38d9a6d4
commit 6b91cde43a
2 changed files with 8 additions and 1 deletions

View file

@ -610,7 +610,10 @@ func (e *Editor) connectAppSignals() {
if runtime.GOOS == "darwin" {
e.openingFileCh = make(chan string, 2)
if e.openingFileCh == nil {
e.openingFileCh = make(chan string, 2)
}
go func() {
for {
openingFile := <-e.openingFileCh

View file

@ -13,6 +13,10 @@ import "unsafe"
func GetOpeningFilepath(str *C.char) {
goStr := C.GoString(str)
C.free(unsafe.Pointer(str))
if editor.openingFileCh == nil {
editor.openingFileCh = make(chan string, 2)
}
editor.openingFileCh <- goStr
}