haiku: fix modelist double-free
This commit is contained in:
@@ -245,9 +245,8 @@ bool HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
|
|||||||
uint32 count, i;
|
uint32 count, i;
|
||||||
|
|
||||||
// Get graphics-hardware supported modes
|
// Get graphics-hardware supported modes
|
||||||
bscreen.GetModeList(&bmodes, &count);
|
if (bscreen.GetModeList(&bmodes, &count) == B_OK && bscreen.GetMode(&this_bmode) == B_OK)
|
||||||
bscreen.GetMode(&this_bmode);
|
{
|
||||||
|
|
||||||
for (i = 0; i < count; ++i) {
|
for (i = 0; i < count; ++i) {
|
||||||
// FIXME: Apparently there are errors with colorspace changes
|
// FIXME: Apparently there are errors with colorspace changes
|
||||||
if (bmodes[i].space == this_bmode.space) {
|
if (bmodes[i].space == this_bmode.space) {
|
||||||
@@ -257,6 +256,9 @@ bool HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
|
|||||||
}
|
}
|
||||||
free(bmodes); // This should NOT be SDL_free()
|
free(bmodes); // This should NOT be SDL_free()
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user