~eliasnaur/gio-patches

app/internal/window: fix issue raised by -race and -checkptr passes v2 PROPOSED

Sebastien Binet: 1
 app/internal/window: fix issue raised by -race and -checkptr passes

 1 files changed, 3 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/11350/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH v2] app/internal/window: fix issue raised by -race and -checkptr passes Export this patch

This CL fixes the error message that's issued by the race detector
(Go-1.15) when closing an app.Window:

fatal error: checkptr: converted pointer straddles multiple allocations
---
 app/internal/window/os_x11.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go
index f986243..6089251 100644
--- a/app/internal/window/os_x11.go
+++ b/app/internal/window/os_x11.go
@@ -115,7 +115,7 @@ func (w *x11Window) Close() {
	w.mu.Lock()
	defer w.mu.Unlock()

	ev := C.XClientMessageEvent{
	ev := &C.XClientMessageEvent{
		_type:        C.ClientMessage,
		display:      w.x,
		window:       w.xw,
@@ -125,7 +125,8 @@ func (w *x11Window) Close() {
	arr := (*[5]C.long)(unsafe.Pointer(&ev.data))
	arr[0] = C.long(w.atoms.evDelWindow)
	arr[1] = C.CurrentTime
	C.XSendEvent(w.x, w.xw, C.False, C.NoEventMask, (*C.XEvent)(unsafe.Pointer(&ev)))
	xev := *(**C.XEvent)(unsafe.Pointer(&ev))
	C.XSendEvent(w.x, w.xw, C.False, C.NoEventMask, xev)
}

var x11OneByte = make([]byte, 1)
-- 
2.27.0