File: finalizers.go

package info (click to toggle)
golang-github-gotk3-gotk3 0.6.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,392 kB
  • sloc: ansic: 914; makefile: 4
file content (14 lines) | stat: -rw-r--r-- 578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package glib

// Finalizer is a function that when called will finalize an object
type Finalizer func()

// FinalizerStrategy will be called by every runtime finalizer in gotk3
// The simple version will just call the finalizer given as an argument
// but in larger programs this might cause problems with the UI thread.
// The FinalizerStrategy function will always be called in the goroutine that
// `runtime.SetFinalizer` uses. It is a `var` to explicitly allow clients to
// change the strategy to something more advanced.
var FinalizerStrategy = func(f Finalizer) {
	f()
}