mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix a few issues with the size of the logger pane.
Also some other general clean up issues. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7401 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1571,7 +1571,7 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
|
||||
{
|
||||
u32 W = back_rc.GetWidth();
|
||||
u32 H = back_rc.GetHeight();
|
||||
u8 *data = new u8[3 * W * H]; // TODO: possible memleak, and new'd data is given to wxImage which requires malloc
|
||||
u8 *data = (u8 *)malloc((sizeof(u8) * 3 * W * H));
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
|
||||
glReadPixels(back_rc.left, back_rc.bottom, W, H, GL_RGB, GL_UNSIGNED_BYTE, data);
|
||||
@ -1579,6 +1579,7 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
|
||||
// Show failure message
|
||||
if (GL_REPORT_ERROR() != GL_NO_ERROR)
|
||||
{
|
||||
free(data);
|
||||
OSD::AddMessage("Error capturing or saving screenshot.", 2000);
|
||||
return false;
|
||||
}
|
||||
@ -1608,7 +1609,7 @@ bool Renderer::SaveScreenshot(const std::string &filename, const TargetRectangle
|
||||
|
||||
#else
|
||||
bool result = SaveTGA(filename.c_str(), W, H, data);
|
||||
delete[] data;
|
||||
free(data);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user