Fix possible segfault in X backend
This commit is contained in:
parent
1eceb53b94
commit
02d010818f
@ -33,6 +33,10 @@ func (backend *Backend) handleConfigureNotify (
|
|||||||
configureEvent =
|
configureEvent =
|
||||||
backend.compressConfigureNotify(configureEvent)
|
backend.compressConfigureNotify(configureEvent)
|
||||||
|
|
||||||
|
// we should not resize the canvas while drawing is taking place
|
||||||
|
backend.drawLock.Lock()
|
||||||
|
defer backend.drawLock.Unlock()
|
||||||
|
|
||||||
// resize buffer
|
// resize buffer
|
||||||
width, height := backend.calculateBufferSize()
|
width, height := backend.calculateBufferSize()
|
||||||
backend.application.SetSize(width, height)
|
backend.application.SetSize(width, height)
|
||||||
|
@ -44,7 +44,7 @@ func main () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func redraw () {
|
func redraw () {
|
||||||
text :="RAINBOW :D"
|
text := "RAINBOW :D"
|
||||||
width, height := application.Size()
|
width, height := application.Size()
|
||||||
|
|
||||||
application.Dot.X = (width - len(text)) / 2
|
application.Dot.X = (width - len(text)) / 2
|
||||||
|
Loading…
Reference in New Issue
Block a user