mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-03 23:26:32 +08:00
major rework of reference handling
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user