Skip to content

Commit 5a66e6c

Browse files
committed
Record painting tref before Init is called.
Fixes #63.
1 parent 1e309cc commit 5a66e6c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bridge.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,13 @@ func convertParam(methodName string, index int, param reflect.Value, argt reflec
523523

524524
//export hookGoValuePaint
525525
func hookGoValuePaint(enginep, foldp unsafe.Pointer, reflectIndex C.intptr_t) {
526-
fold := ensureEngine(enginep, foldp)
527-
v := reflect.ValueOf(fold.gvalue)
528-
529526
// The main GUI thread is mutex-locked while paint methods are called,
530527
// so no two paintings should be happening at the same time.
531528
atomic.StoreUintptr(&guiPaintRef, tref.Ref())
532529

530+
fold := ensureEngine(enginep, foldp)
531+
v := reflect.ValueOf(fold.gvalue)
532+
533533
painter := &Painter{fold.engine, &Common{fold.cvalue, fold.engine}}
534534

535535
method := v.Method(int(reflectIndex))

0 commit comments

Comments
 (0)