Also free() the direct_buffer_info on destruction. Use malloc() instead

of calloc, since the memory is memcpy()'d in the next line. Added a TODO
comment. +alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32767 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2009-08-27 20:48:00 +00:00
parent 11dbc6cf7a
commit c617eabd63
1 changed files with 8 additions and 1 deletions

View File

@ -320,6 +320,8 @@ MesaSoftwareRenderer::~MesaSoftwareRenderer()
_mesa_destroy_framebuffer(fFrameBuffer); _mesa_destroy_framebuffer(fFrameBuffer);
_mesa_destroy_context(fContext); _mesa_destroy_context(fContext);
free(fInfo);
delete fBitmap; delete fBitmap;
} }
@ -577,10 +579,15 @@ MesaSoftwareRenderer::EnableDirectMode(bool enabled)
void void
MesaSoftwareRenderer::DirectConnected(direct_buffer_info *info) MesaSoftwareRenderer::DirectConnected(direct_buffer_info *info)
{ {
// TODO: I'm not sure we need to do this: BGLView already
// keeps a local copy of the direct_buffer_info passed by
// BDirectWindow::DirectConnected().
BAutolock lock(fInfoLocker); BAutolock lock(fInfoLocker);
if (info) { if (info) {
if (!fInfo) { if (!fInfo) {
fInfo = (direct_buffer_info *)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE); fInfo = (direct_buffer_info *)malloc(DIRECT_BUFFER_INFO_AREA_SIZE);
if (!fInfo)
return;
} }
memcpy(fInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE); memcpy(fInfo, info, DIRECT_BUFFER_INFO_AREA_SIZE);
} else if (fInfo) { } else if (fInfo) {