Files
go-gst/examples/plugins/registered_elements/internal/common/assert.go
RSWilli 72543a2372 add example which registers and uses go custom elements
this example has an assert that checks wether or nor the finalizers ran correctly. If they don't then a mem leak will happen
2024-11-15 17:21:35 +01:00

12 lines
242 B
Go

package common
import "fmt"
var FinalizersCalled int = 0
func AssertFinalizersCalled(x int) {
if FinalizersCalled != x {
panic(fmt.Sprintf("finalizers did not run correctly, memory leak, wanted: %d, got: %d", x, FinalizersCalled))
}
}