mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-04 07:36:41 +08:00
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
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
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))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user