PSP: Fixed ImageViewer code to deallocate TimedMessageDialog

Not deallocating it before loading the next image causes fragmentation in memory which eventually prevents big things from being loaded into memory.

svn-id: r53873
This commit is contained in:
Yotam Barnoy 2010-10-27 11:09:03 +00:00
parent 415f9a1b0b
commit 13b6e0d69a

View file

@ -145,8 +145,10 @@ void ImageViewer::setVisible(bool visible) {
_visible = true;
setViewerButtons(true);
GUI::TimedMessageDialog dialog("Image Viewer", 1000);
dialog.runModal();
{ // so dialog goes out of scope, destroying all allocations
GUI::TimedMessageDialog dialog("Image Viewer", 1000);
dialog.runModal();
}
runLoop(); // only listen to viewer events
} else { // we were asked to make invisible or failed to load