The lua code could keep a reference to out cairo surface for a drawin after it was destroyed. So make sure the surface is finished before the associated drawable is destroyed. Signed-off-by: Uli Schlachter <psychon@znc.in>