Temporary fix for #65.

It looks like that when we use the `Simple` output module, we get
weird errors when trying to load state for any game, most likely due to
memory corruption. AFAIK, it seems the frame buffer is not large enough
to render all components.

This issues does not appear when using OpenGL, or using the Simple with
any display filter available.
This commit is contained in:
Edênis Freindorfer Azevedo 2019-07-01 15:51:20 -03:00 committed by Rafael Kitover
parent d585a61049
commit c366907f64
1 changed files with 7 additions and 3 deletions

View File

@ -31,6 +31,7 @@ GameArea::GameArea()
, rewind_time(0) , rewind_time(0)
, do_rewind(false) , do_rewind(false)
, rewind_mem(0) , rewind_mem(0)
, num_rewind_states(0)
, loaded(IMAGE_UNKNOWN) , loaded(IMAGE_UNKNOWN)
, basic_width(GBAWidth) , basic_width(GBAWidth)
, basic_height(GBAHeight) , basic_height(GBAHeight)
@ -1860,6 +1861,7 @@ void DrawingPanelBase::DrawArea(uint8_t** data)
showSpeedTransparent); showSpeedTransparent);
free(buf); free(buf);
buf = NULL;
} else } else
panel->osdtext.clear(); panel->osdtext.clear();
} }
@ -1978,9 +1980,11 @@ void DrawingPanelBase::OnSize(wxSizeEvent& ev)
DrawingPanelBase::~DrawingPanelBase() DrawingPanelBase::~DrawingPanelBase()
{ {
// pixbuf1 freed by emulator // pixbuf1 freed by emulator
if (pixbuf2) if (pixbuf1 != pixbuf2 && pixbuf2)
{
free(pixbuf2); free(pixbuf2);
pixbuf2 = NULL;
}
InterframeCleanup(); InterframeCleanup();
if (nthreads) { if (nthreads) {
@ -2004,7 +2008,7 @@ BasicDrawingPanel::BasicDrawingPanel(wxWindow* parent, int _width, int _height)
// 16 or 32, though // 16 or 32, though
if (gopts.filter == FF_NONE && gopts.ifb == IFB_NONE) if (gopts.filter == FF_NONE && gopts.ifb == IFB_NONE)
// changing from 32 to 24 does not require regenerating color tables // changing from 32 to 24 does not require regenerating color tables
systemColorDepth = 24; systemColorDepth = 32;
if (!did_init) DrawingPanelInit(); if (!did_init) DrawingPanelInit();
} }