~eliasnaur/gio-patches

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

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

 1 files changed, 3 insertions(+), 1 deletions(-)
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, June 27, 2020 11:03 AM, Elias Naur <mail@eliasnaur.com> wrote:
Next
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/11346/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] 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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go
index f986243..616abf5 100644
--- a/app/internal/window/os_x11.go
+++ b/app/internal/window/os_x11.go
@@ -125,7 +125,9 @@ 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)))
	ptr := uintptr(unsafe.Pointer(&ev))
	xev := *(**C.XEvent)(unsafe.Pointer(&ptr))
	C.XSendEvent(w.x, w.xw, C.False, C.NoEventMask, xev)
}

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