Fix memory leaks (old "screen" bitmap) when resizing the window.

This commit is contained in:
David Capello 2010-10-31 21:32:06 -03:00
parent 60cb43d18c
commit 7768f2c45c
3 changed files with 6 additions and 1 deletions

View File

@ -820,6 +820,7 @@ static BITMAP* osx_qz_window_acknowledge_resize(void)
/* destroy the screen */
private_osx_destroy_screen_data();
destroy_bitmap(pseudo_screen);
/* change the size of the view */
[qd_view setFrameSize: NSMakeSize(w, h)];

View File

@ -782,9 +782,12 @@ static BITMAP *gfx_directx_acknowledge_resize(void)
w -= (w % 4);
_enter_gfx_critical();
/* Destroy old screen */
destroy_bitmap(gfx_directx_forefront_bitmap);
_destroy_directx_forefront_bitmap();
/* Re-create the screen */
_destroy_directx_forefront_bitmap();
new_screen = _create_directx_forefront_bitmap(w, h, color_depth);
_exit_gfx_critical();

View File

@ -951,6 +951,7 @@ void _xwin_destroy_screen(void)
static BITMAP *_xwin_private_rebuild_screen(int w, int h, int color_depth)
{
_xwin_private_destroy_screen_data();
destroy_bitmap(screen);
/* Save dimensions. */
_xwin.window_width = w;