present: Signal destroyed flip window with vblank->window == NULL
authorKeith Packard <keithp@keithp.com>
Sat, 9 Nov 2013 20:36:47 +0000 (12:36 -0800)
committerKeith Packard <keithp@keithp.com>
Wed, 20 Nov 2013 21:12:27 +0000 (13:12 -0800)
commite5a188cb919edee2e3a03054276bce0db02f7b62
treeb907abd2d81d8392b3e656f507ac5c710bb8b85e
parenta5bcc4f7b9499caf8993f0a6ef96088553399ca3
present: Signal destroyed flip window with vblank->window == NULL

This eliminates dereferencing freed window pointers when there is a
flip for that window in progress. The flip will complete, and then
immediately get undone (as we can't stop an in-progress flip).

Remove the vblank->window_destroyed field as we can signal this with
vblank->window == NULL instead.

Change check to vblank->window == NULL in:

present_flip_notify

Add check for vblank->window == NULL in:
present_vblank_notify
present_execute

present_flip_notify was also using vblank->window->drawable.pScreen,
so stop doing that and use vblank->screen instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
present/present.c
present/present_priv.h
present/present_screen.c