leaktest

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: MPL-2.0, ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFreed

func AssertFreed(t *testing.T, obj *TrackedObject, context string)

func AssertRefCount

func AssertRefCount(t *testing.T, obj *TrackedObject, expected uint, context string)

func EmitClicked

func EmitClicked(ptr unsafe.Pointer)

func ForceGC

func ForceGC()

func Hold

func Hold(ptr unsafe.Pointer) unsafe.Pointer

Hold adds a C-side reference for testing cleanup while a signal target remains externally alive.

func NewGObject

func NewGObject() unsafe.Pointer

NewGObject creates a fresh GObject (the base GObject type) and returns its raw C pointer. Tests use it with glib.Take/glib.AssumeOwnership to build a *glib.Object. This lives in a cgo-enabled package so test files that are in packages already using cgo (where Go's test scaffolding rejects embedded cgo) can construct GObjects.

func NotifyName

func NotifyName(ptr unsafe.Pointer)

NotifyName emits GObject::notify::name without going through a Go wrapper.

func Release

func Release(ptr unsafe.Pointer)

Release drops a reference returned by Hold.

Types

type TrackedObject

type TrackedObject struct {
	// contains filtered or unexported fields
}

func Track

func Track(ptr unsafe.Pointer) *TrackedObject

func (*TrackedObject) IsFinalized

func (t *TrackedObject) IsFinalized() bool

func (*TrackedObject) RefCount

func (t *TrackedObject) RefCount() uint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL