remove pprof stuff; avoid seg fault

This commit is contained in:
Felix Angell 2018-05-06 20:17:10 +01:00
parent 7da654bbbb
commit 4e03b841a8
4 changed files with 4 additions and 11 deletions

0
f Normal file
View File

0
foo Normal file
View File

View File

@ -111,7 +111,10 @@ func (n *View) ChangeFocus(dir int) {
n.focusedBuff = 0
}
prevBuff.Buff.SetFocus(false)
if prevBuff != nil {
prevBuff.Buff.SetFocus(false)
}
if buffPane, ok := n.buffers[n.focusedBuff]; ok {
buffPane.Buff.SetFocus(true)
}

10
main.go
View File

@ -7,7 +7,6 @@ import (
"os"
"path/filepath"
"runtime"
"runtime/pprof"
"time"
"github.com/felixangell/phi/cfg"
@ -68,15 +67,6 @@ func (n *PhiEditor) render(ctx *strife.Renderer) {
}
func main() {
f, err := os.Create("cpu.prof")
if err != nil {
log.Fatal("could not create CPU profile: ", err)
}
if err := pprof.StartCPUProfile(f); err != nil {
log.Fatal("could not start CPU profile: ", err)
}
defer pprof.StopCPUProfile()
config := cfg.Setup()
ww, wh := 1280, 720