major rework of reference handling

This commit is contained in:
Avi Zimmerman
2021-01-19 00:18:30 +02:00
parent 63a53be42a
commit 1f7d60b390
79 changed files with 1239 additions and 800 deletions

View File

@@ -10,8 +10,6 @@ import (
func Run(f func() error) {
mainLoop := glib.NewMainLoop(glib.MainContextDefault(), false)
defer mainLoop.Unref()
go func() {
if err := f(); err != nil {
fmt.Println("ERROR!", err)
@@ -26,7 +24,6 @@ func Run(f func() error) {
// The main loop itself is passed to the function for more control over exiting.
func RunLoop(f func(*glib.MainLoop) error) {
mainLoop := glib.NewMainLoop(glib.MainContextDefault(), false)
defer mainLoop.Unref()
if err := f(mainLoop); err != nil {
fmt.Println("ERROR!", err)