EndDoubleBuffer() causing a crash

Report any Hollywood bugs here
Post Reply
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

EndDoubleBuffer() causing a crash

Post by Allanon »

Hello Andreas,
I've isolated a piece of code that is actually crashing Hollywood, here is a snippet to reproduce the problem:

Code: Select all

SetDisplayAttributes({ sizeable = True })

;---------------------------------
; This snippet will cause a crash:
; *** Try to resize the window vertically and it will crash
; *** Seems that resizing horizontally is safe
;---------------------------------

Function render()
  ; Something to do in the interval function...
  Box(Rnd(200), Rnd(200), Rnd(200)+1, Rnd(200)+1, GetRandomColor())
  Flip()
EndFunction

Function resizeEvent(msg)
  ; Resize event received from the event handler
  ; If there is a vertical resize Hollywood will crash, horizontal resize seems safe
  ; -------------------------------
  ; Dump of the event message
  ForEach(msg, DebugPrint)

  ; EndDoubleBuffer() will crash Hollywood...
  DebugPrint("Crashing!!!")
  EndDoubleBuffer()

  ; This line is reached only if there is an horizontal resize
  DebugPrint("Crashed ?")

  ; --- In the original code here I'm doing some stuff to manipulate the display attributes

  ; Restart the double buffer...
  BeginDoubleBuffer()
EndFunction


SetInterval(Nil, render, 1000/50)
InstallEventHandler({ SizeWindow = resizeEvent })

BeginDoubleBuffer()

SetFillStyle(#FILLCOLOR)
Repeat
  WaitEvent()
Forever
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: EndDoubleBuffer() causing a crash

Post by airsoftsoftwair »

Right, this is clearly a bug. It's fixed now. Thanks for the report!
Post Reply