Skip to content

Commit

Permalink
Temporary fix for #65.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
denisfa authored and rkitover committed Jul 3, 2019
1 parent d585a61 commit c366907
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/wx/panel.cpp
Expand Up @@ -31,6 +31,7 @@ GameArea::GameArea()
, rewind_time(0)
, do_rewind(false)
, rewind_mem(0)
, num_rewind_states(0)
, loaded(IMAGE_UNKNOWN)
, basic_width(GBAWidth)
, basic_height(GBAHeight)
Expand Down Expand Up @@ -1860,6 +1861,7 @@ void DrawingPanelBase::DrawArea(uint8_t** data)
showSpeedTransparent);

free(buf);
buf = NULL;
} else
panel->osdtext.clear();
}
Expand Down Expand Up @@ -1978,9 +1980,11 @@ void DrawingPanelBase::OnSize(wxSizeEvent& ev)
DrawingPanelBase::~DrawingPanelBase()
{
// pixbuf1 freed by emulator
if (pixbuf2)
if (pixbuf1 != pixbuf2 && pixbuf2)
{
free(pixbuf2);

pixbuf2 = NULL;
}
InterframeCleanup();

if (nthreads) {
Expand All @@ -2004,7 +2008,7 @@ BasicDrawingPanel::BasicDrawingPanel(wxWindow* parent, int _width, int _height)
// 16 or 32, though
if (gopts.filter == FF_NONE && gopts.ifb == IFB_NONE)
// changing from 32 to 24 does not require regenerating color tables
systemColorDepth = 24;
systemColorDepth = 32;
if (!did_init) DrawingPanelInit();
}

Expand Down

0 comments on commit c366907

Please sign in to comment.