From 9441987446d204910a7707272c0f3a7d17f9830c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 11 Feb 2010 00:29:56 +0100 Subject: remove knowledge of defaultallocator_free_displaysurface from sdl.c Let register_displayallocator hand over the old width/height to the new allocator. Signed-off-by: Paolo Bonzini Signed-off-by: Anthony Liguori --- vl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index bfbd0afc73..599a0803d7 100644 --- a/vl.c +++ b/vl.c @@ -2615,7 +2615,13 @@ DisplayState *get_displaystate(void) DisplayAllocator *register_displayallocator(DisplayState *ds, DisplayAllocator *da) { - if(ds->allocator == &default_allocator) ds->allocator = da; + if(ds->allocator == &default_allocator) { + DisplaySurface *surf; + surf = da->create_displaysurface(ds_get_width(ds), ds_get_height(ds)); + defaultallocator_free_displaysurface(ds->surface); + ds->surface = surf; + ds->allocator = da; + } return ds->allocator; } -- cgit v1.2.1