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