cutego/qt_wasm.go
therecipe 47435cc1dd various fixes for wasm, raspberry, go 1.12 and minor issues + initial support for Felgo (former V-Play)
* js/wasm GOCACHE fix for Go 1.12+
* make use of the official Go 1.12 wasm build and replace js.NewCallback with js.FuncOf
* update docker images to Go 1.12.4
* revive raspberry images
* fix raspberry related bundling issue
* add the multimedia module to the raspberry images
* fix raspberry related QT_API issue
* remove unecessary *char to []byte copy overhead in some unlikely cases
* fix Qt install script
* initial partially support for Felgo (former V-Play) on darwin
* fix charts/audio example and darwin
* fix common/widgets_demo example on iOS (issue #451)
* fix widgets/renderer memory leak
* fix possible QT_PKG_CONFIG + QT_VERSION race condition
* fix static linux docker image
2019-04-16 18:28:55 +02:00

25 lines
426 B
Go

// +build js,wasm
package qt
import (
"syscall/js"
"unsafe"
)
func init() {
WASM.Set("_callbackReleaseTypedArray", js.FuncOf(func(_ js.Value, args []js.Value) interface{} {
(*js.TypedArray)(unsafe.Pointer(uintptr(args[0].Int()))).Release()
return nil
}))
}
var Global = js.Global()
var Module = Global.Call("eval", "Module")
//TODO: func MakeWrapper(i interface{}) *js.Value
//
var WASM = Module //TODO: remove