--- a/webengine/osswebengine/WebCore/platform/graphics/symbian/ImageSymbian.cpp Fri Jul 03 15:54:40 2009 +0100
+++ b/webengine/osswebengine/WebCore/platform/graphics/symbian/ImageSymbian.cpp Thu Aug 27 07:44:59 2009 +0300
@@ -25,6 +25,7 @@
*/
#include "config.h"
+#include "ImageSymbian.h"
#include "BitmapImage.h"
#include "FloatRect.h"
#include "ImageObserver.h"
@@ -183,8 +184,13 @@
// Feed all the data we've seen so far to the image decoder.
m_allDataReceived = allDataReceived;
- m_source.setData(m_data.get(), allDataReceived);
-
+ TRAPD(oomErr, m_source.setDataL(m_data.get(), allDataReceived));
+ if (oomErr == KErrNoMemory)
+ {
+ //We are OOM, this should be reported as an error and image load
+ // must be stopped.
+ return false;
+ }
// Image properties will not be available until the first frame of the file
// reaches kCGImageStatusIncomplete.
return isSizeAvailable();
@@ -368,13 +374,11 @@
#endif
static HBufC* iconFileNameBuf = NULL;
-struct cleanupIconFileName {
- ~cleanupIconFileName() {
+
+void cleanupIconFileName() {
delete iconFileNameBuf;
iconFileNameBuf = NULL;
- }
-};
-struct cleanupIconFileName cleanIconFileName;
+}
TPtrC iconFileName()
{