Remove checks in fxge/{apple,win32,skia,dib} now that FX_NEW cant return 0

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1062863006
diff --git a/core/src/fxge/apple/fx_mac_imp.cpp b/core/src/fxge/apple/fx_mac_imp.cpp
index 5acedc0..75489ea 100644
--- a/core/src/fxge/apple/fx_mac_imp.cpp
+++ b/core/src/fxge/apple/fx_mac_imp.cpp
@@ -87,10 +87,7 @@
 }
 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
 {
-    CFX_MacFontInfo* pInfo = FX_NEW CFX_MacFontInfo;
-    if (!pInfo) {
-        return NULL;
-    }
+    CFX_MacFontInfo* pInfo = new CFX_MacFontInfo;
     pInfo->AddPath("~/Library/Fonts");
     pInfo->AddPath("/Library/Fonts");
     pInfo->AddPath("/System/Library/Fonts");
@@ -98,7 +95,7 @@
 }
 void CFX_GEModule::InitPlatform()
 {
-    m_pPlatformData = FX_NEW CApplePlatform;
+    m_pPlatformData = new CApplePlatform;
     m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault());
 }
 void CFX_GEModule::DestroyPlatform()
diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp
index 050d874..f7faee1 100644
--- a/core/src/fxge/apple/fx_quartz_device.cpp
+++ b/core/src/fxge/apple/fx_quartz_device.cpp
@@ -1097,10 +1097,7 @@
     }
     m_pContext = context;
     CGContextRetain(m_pContext);
-    IFX_RenderDeviceDriver* pDriver = FX_NEW CFX_QuartzDeviceDriver(m_pContext, nDeviceClass);
-    if (!pDriver) {
-        return FALSE;
-    }
+    IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, nDeviceClass);
     SetDeviceDriver(pDriver);
     return TRUE;
 }
@@ -1111,10 +1108,7 @@
     if (NULL == m_pContext) {
         return FALSE;
     }
-    IFX_RenderDeviceDriver* pDriver = FX_NEW CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY);
-    if (!pDriver) {
-        return FALSE;
-    }
+    IFX_RenderDeviceDriver* pDriver = new CFX_QuartzDeviceDriver(m_pContext, FXDC_DISPLAY);
     SetDeviceDriver(pDriver);
     return TRUE;
 }
@@ -1123,10 +1117,7 @@
     if ((FX_BYTE)format < 32) {
         return FALSE;
     }
-    CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
-    if (!pBitmap) {
-        return FALSE;
-    }
+    CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
     if (!pBitmap->Create(width, height, format)) {
         delete pBitmap;
         return FALSE;
diff --git a/core/src/fxge/dib/fx_dib_convert.cpp b/core/src/fxge/dib/fx_dib_convert.cpp
index cfcbc70..7932305 100644
--- a/core/src/fxge/dib/fx_dib_convert.cpp
+++ b/core/src/fxge/dib/fx_dib_convert.cpp
@@ -942,10 +942,7 @@
         }
         return pClone;
     }
-    CFX_DIBitmap* pClone = FX_NEW CFX_DIBitmap;
-    if (!pClone) {
-        return NULL;
-    }
+    CFX_DIBitmap* pClone = new CFX_DIBitmap;
     if(!pClone->Create(m_Width, m_Height, dest_format)) {
         delete pClone;
         return NULL;
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index f4c0ef1..997ca1d 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -765,10 +765,7 @@
 #define MAX_PROGRESSIVE_STRETCH_PIXELS	1000000
 FX_BOOL CFX_ImageStretcher::StartStretch()
 {
-    m_pStretchEngine = FX_NEW CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect, m_pSource, m_Flags);
-    if (!m_pStretchEngine) {
-        return FALSE;
-    }
+    m_pStretchEngine = new CStretchEngine(m_pDest, m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect, m_pSource, m_Flags);
     m_pStretchEngine->StartStretchHorz();
     if (m_pSource->GetWidth() * m_pSource->GetHeight() < MAX_PROGRESSIVE_STRETCH_PIXELS) {
         m_pStretchEngine->Continue(NULL);
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp
index 2cb41f6..59c0bd6 100644
--- a/core/src/fxge/dib/fx_dib_main.cpp
+++ b/core/src/fxge/dib/fx_dib_main.cpp
@@ -164,10 +164,7 @@
             return NULL;
         }
     }
-    CFX_DIBitmap* pNewBitmap = FX_NEW CFX_DIBitmap;
-    if (!pNewBitmap) {
-        return NULL;
-    }
+    CFX_DIBitmap* pNewBitmap = new CFX_DIBitmap;
     if (!pNewBitmap->Create(rect.Width(), rect.Height(), GetFormat())) {
         delete pNewBitmap;
         return NULL;
@@ -236,10 +233,7 @@
     if (m_pAlphaMask) {
         return TRUE;
     }
-    m_pAlphaMask = FX_NEW CFX_DIBitmap;
-    if (!m_pAlphaMask) {
-        return FALSE;
-    }
+    m_pAlphaMask = new CFX_DIBitmap;
     if (!m_pAlphaMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
         delete m_pAlphaMask;
         m_pAlphaMask = NULL;
@@ -574,10 +568,7 @@
             return NULL;
         }
     }
-    CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
-    if (!pMask) {
-        return NULL;
-    }
+    CFX_DIBitmap* pMask = new CFX_DIBitmap;
     if (!pMask->Create(rect.Width(), rect.Height(), FXDIB_8bppMask)) {
         delete pMask;
         return NULL;
@@ -902,10 +893,7 @@
                     int b = (FX_BYTE)m_pPalette[i];
                     gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
                 }
-                CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
-                if (!pMask) {
-                    return FALSE;
-                }
+                CFX_DIBitmap* pMask = new CFX_DIBitmap;
                 if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
                     delete pMask;
                     return FALSE;
@@ -936,10 +924,7 @@
                     int b = (FX_BYTE)m_pPalette[i];
                     gray[i] = (FX_BYTE)FXRGB2GRAY(r, g, b);
                 }
-                CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
-                if (!pMask) {
-                    return FALSE;
-                }
+                CFX_DIBitmap* pMask = new CFX_DIBitmap;
                 if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
                     delete pMask;
                     return FALSE;
@@ -956,10 +941,7 @@
                 break;
             }
         case FXDIB_Rgb: {
-                CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
-                if (!pMask) {
-                    return FALSE;
-                }
+                CFX_DIBitmap* pMask = new CFX_DIBitmap;
                 if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
                     delete pMask;
                     return FALSE;
@@ -977,10 +959,7 @@
                 break;
             }
         case FXDIB_Rgb32: {
-                CFX_DIBitmap* pMask = FX_NEW CFX_DIBitmap;
-                if (!pMask) {
-                    return FALSE;
-                }
+                CFX_DIBitmap* pMask = new CFX_DIBitmap;
                 if (!pMask->Create(m_Width, m_Height, FXDIB_8bppMask)) {
                     delete pMask;
                     return FALSE;
@@ -1414,10 +1393,7 @@
 }
 CFX_DIBitmap* CFX_DIBSource::FlipImage(FX_BOOL bXFlip, FX_BOOL bYFlip) const
 {
-    CFX_DIBitmap* pFlipped = FX_NEW CFX_DIBitmap;
-    if (!pFlipped) {
-        return NULL;
-    }
+    CFX_DIBitmap* pFlipped = new CFX_DIBitmap;
     if (!pFlipped->Create(m_Width, m_Height, GetFormat())) {
         delete pFlipped;
         return NULL;
@@ -1491,10 +1467,7 @@
     if (pSrc->GetBuffer() == NULL) {
         m_pBitmap = pSrc->Clone();
     } else {
-        m_pBitmap = FX_NEW CFX_DIBitmap;
-        if (!m_pBitmap) {
-            return;
-        }
+        m_pBitmap = new CFX_DIBitmap;
         if (!m_pBitmap->Create(pSrc->GetWidth(), pSrc->GetHeight(), pSrc->GetFormat(), pSrc->GetBuffer())) {
             delete m_pBitmap;
             m_pBitmap = NULL;
@@ -1605,10 +1578,7 @@
             return TRUE;
         }
         m_Status = 2;
-        m_pTransformer = FX_NEW CFX_ImageTransformer;
-        if (!m_pTransformer) {
-            return FALSE;
-        }
+        m_pTransformer = new CFX_ImageTransformer;
         m_pTransformer->Start(pSource, &m_Matrix, dib_flags, &m_ClipBox);
         return TRUE;
     }
@@ -1707,10 +1677,7 @@
 }
 FX_BOOL CFX_BitmapStorer::SetInfo(int width, int height, FXDIB_Format src_format, FX_DWORD* pSrcPalette)
 {
-    m_pBitmap = FX_NEW CFX_DIBitmap;
-    if (!m_pBitmap) {
-        return FALSE;
-    }
+    m_pBitmap = new CFX_DIBitmap;
     if (!m_pBitmap->Create(width, height, src_format)) {
         delete m_pBitmap;
         m_pBitmap = NULL;
diff --git a/core/src/fxge/dib/fx_dib_transform.cpp b/core/src/fxge/dib/fx_dib_transform.cpp
index 65afdd6..457fe2e 100644
--- a/core/src/fxge/dib/fx_dib_transform.cpp
+++ b/core/src/fxge/dib/fx_dib_transform.cpp
@@ -63,10 +63,7 @@
     if (dest_clip.IsEmpty()) {
         return NULL;
     }
-    CFX_DIBitmap* pTransBitmap = FX_NEW CFX_DIBitmap;
-    if (!pTransBitmap) {
-        return NULL;
-    }
+    CFX_DIBitmap* pTransBitmap = new CFX_DIBitmap;
     int result_height = dest_clip.Height(), result_width = dest_clip.Width();
     if (!pTransBitmap->Create(result_width, result_height, GetFormat())) {
         delete pTransBitmap;
@@ -369,10 +366,7 @@
         stretch_buf_mask = m_Storer.GetBitmap()->m_pAlphaMask->GetBuffer();
     }
     int stretch_pitch = m_Storer.GetBitmap()->GetPitch();
-    CFX_DIBitmap* pTransformed = FX_NEW CFX_DIBitmap;
-    if (!pTransformed) {
-        return FALSE;
-    }
+    CFX_DIBitmap* pTransformed = new CFX_DIBitmap;
     FXDIB_Format transformF = _GetTransformedFormat(m_Stretcher.m_pSource);
     if (!pTransformed->Create(m_ResultWidth, m_ResultHeight, transformF)) {
         delete pTransformed;
diff --git a/core/src/fxge/skia/fx_skia_device.cpp b/core/src/fxge/skia/fx_skia_device.cpp
index 6c329ee..cc4059d 100644
--- a/core/src/fxge/skia/fx_skia_device.cpp
+++ b/core/src/fxge/skia/fx_skia_device.cpp
@@ -237,7 +237,7 @@
 
 CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
 {
-	m_pAggDriver = FX_NEW CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
+	m_pAggDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
 }
 CFX_SkiaDeviceDriver::~CFX_SkiaDeviceDriver()
 {
@@ -300,7 +300,7 @@
 						)
 {
 	if (m_pAggDriver->m_pClipRgn == NULL)
-		m_pAggDriver->m_pClipRgn = FX_NEW CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
+		m_pAggDriver->m_pClipRgn = new CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
 
 	if (pPathData->GetPointCount() == 5 || pPathData->GetPointCount() == 4) {
 		CFX_FloatRect rectf;
@@ -332,7 +332,7 @@
 					)
 {
 	if (m_pAggDriver->m_pClipRgn == NULL)
-		m_pAggDriver->m_pClipRgn = FX_NEW CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
+		m_pAggDriver->m_pClipRgn = new CFX_ClipRgn(GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
 
 	// build path data
 	CSkia_PathData path_data;
@@ -505,7 +505,7 @@
 	if (pBitmap == NULL) 
 		return FALSE;
 	SetBitmap(pBitmap);
-	CFX_SkiaDeviceDriver* pDriver = FX_NEW CFX_SkiaDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
+	CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
 	SetDeviceDriver(pDriver);
 	return TRUE;
 }
@@ -513,13 +513,13 @@
 FX_BOOL CFX_SkiaDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
 {
 	m_bOwnedBitmap = TRUE;
-	CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
+	CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
 	if (!pBitmap->Create(width, height, format)) {
 		delete pBitmap;
 		return FALSE;
 	} 
 	SetBitmap(pBitmap);
-	CFX_SkiaDeviceDriver* pDriver =  FX_NEW CFX_SkiaDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
+	CFX_SkiaDeviceDriver* pDriver =  new CFX_SkiaDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
 	SetDeviceDriver(pDriver);
 	return TRUE;
 }
@@ -528,4 +528,4 @@
 	if (m_bOwnedBitmap && GetBitmap()) delete GetBitmap();
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index debf94d..00baa2b 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -393,14 +393,11 @@
 }
 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault()
 {
-    return FX_NEW CWin32FontInfo;
+    return new CWin32FontInfo;
 }
 void CFX_GEModule::InitPlatform()
 {
-    CWin32Platform* pPlatformData = FX_NEW CWin32Platform;
-    if (!pPlatformData) {
-        return;
-    }
+    CWin32Platform* pPlatformData = new CWin32Platform;
     OSVERSIONINFO ver;
     ver.dwOSVersionInfoSize = sizeof(ver);
     GetVersionEx(&ver);
@@ -1143,10 +1140,7 @@
     m_bForcePSOutput = bForcePSOutput;
     m_psLevel = psLevel;
     if (bForcePSOutput) {
-        IFX_RenderDeviceDriver* pDriver = FX_NEW CPSPrinterDriver;
-        if (!pDriver) {
-            return;
-        }
+        IFX_RenderDeviceDriver* pDriver = new CPSPrinterDriver;
         ((CPSPrinterDriver*)pDriver)->Init(hDC, psLevel, bCmykOutput);
         SetDeviceDriver(pDriver);
         return;
@@ -1172,9 +1166,9 @@
         device_class = FXDC_DISPLAY;
     }
     if (device_class == FXDC_PRINTER) {
-        return FX_NEW CGdiPrinterDriver(hDC);
+        return new CGdiPrinterDriver(hDC);
     }
-    return FX_NEW CGdiDisplayDriver(hDC);
+    return new CGdiDisplayDriver(hDC);
 }
 CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, int height, FXDIB_Format format)
 {
@@ -1190,18 +1184,12 @@
     if (m_hBitmap == NULL) {
         return;
     }
-    CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
-    if (!pBitmap) {
-        return;
-    }
+    CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
     pBitmap->Create(width, height, format, pBuffer);
     SetBitmap(pBitmap);
     m_hDC = ::CreateCompatibleDC(NULL);
     m_hOldBitmap = (HBITMAP)SelectObject(m_hDC, m_hBitmap);
-    IFX_RenderDeviceDriver* pDriver = FX_NEW CGdiDisplayDriver(m_hDC);
-    if (!pDriver) {
-        return;
-    }
+    IFX_RenderDeviceDriver* pDriver = new CGdiDisplayDriver(m_hDC);
     SetDeviceDriver(pDriver);
 }
 CFX_WinBitmapDevice::~CFX_WinBitmapDevice()
diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp
index 2ecf539..ec523c3 100644
--- a/core/src/fxge/win32/fx_win32_dib.cpp
+++ b/core/src/fxge/win32/fx_win32_dib.cpp
@@ -59,10 +59,7 @@
         bBottomUp = FALSE;
     }
     int pitch = (width * pbmi->bmiHeader.biBitCount + 31) / 32 * 4;
-    CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap;
-    if (!pBitmap) {
-        return NULL;
-    }
+    CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
     FXDIB_Format format = bAlpha ? (FXDIB_Format)(pbmi->bmiHeader.biBitCount + 0x200) : (FXDIB_Format)pbmi->bmiHeader.biBitCount;
     FX_BOOL ret = pBitmap->Create(width, height, format);
     if (!ret) {
@@ -135,11 +132,7 @@
     HDC hDC = CreateCompatibleDC(NULL);
     int width, height;
     GetBitmapSize(hBitmap, width, height);
-    CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
-    if (!pDIBitmap) {
-        DeleteDC(hDC);
-        return NULL;
-    }
+    CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
     if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
         delete pDIBitmap;
         DeleteDC(hDC);
@@ -171,11 +164,7 @@
     HDC hDC = CreateCompatibleDC(NULL);
     int width, height;
     GetBitmapSize(hBitmap, width, height);
-    CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
-    if (!pDIBitmap) {
-        DeleteDC(hDC);
-        return NULL;
-    }
+    CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
     if (!pDIBitmap->Create(width, height, FXDIB_Rgb)) {
         delete pDIBitmap;
         DeleteDC(hDC);
@@ -206,10 +195,7 @@
     int height = abs(bmih.biHeight);
     bmih.biHeight = -height;
     bmih.biCompression = BI_RGB;
-    CFX_DIBitmap* pDIBitmap = FX_NEW CFX_DIBitmap;
-    if (!pDIBitmap) {
-        return NULL;
-    }
+    CFX_DIBitmap* pDIBitmap = new CFX_DIBitmap;
     int ret = 0;
     if (bmih.biBitCount == 1 || bmih.biBitCount == 8) {
         int size = sizeof (BITMAPINFOHEADER) + 8;
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index 1ad4f8c..7a17c4a 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -57,8 +57,7 @@
     static IDWriteFontFileLoader* GetLoader()
     {
         if (instance_ == NULL) {
-            instance_ = FX_NEW CDwFontFileLoader();
-            return instance_;
+            instance_ = new CDwFontFileLoader();
         }
         return instance_;
     }
@@ -209,10 +208,7 @@
     if (FAILED(hr)) {
         goto failed;
     }
-    *(CDwGdiTextRenderer**)renderTarget = FX_NEW CDwGdiTextRenderer(pBitmap, pBitmapRenderTarget, pRenderingParams);
-    if (*(CDwGdiTextRenderer**)renderTarget == NULL) {
-        goto failed;
-    }
+    *(CDwGdiTextRenderer**)renderTarget = new CDwGdiTextRenderer(pBitmap, pBitmapRenderTarget, pRenderingParams);
     SafeRelease(&pGdiInterop);
     SafeRelease(&pBitmapRenderTarget);
     SafeRelease(&pRenderingParams);
@@ -372,10 +368,7 @@
 )
 {
     *fontFileStream = NULL;
-    CDwFontFileStream* stream = FX_NEW CDwFontFileStream(fontFileReferenceKey, fontFileReferenceKeySize);
-    if (stream == NULL)	{
-        return E_OUTOFMEMORY;
-    }
+    CDwFontFileStream* stream = new CDwFontFileStream(fontFileReferenceKey, fontFileReferenceKeySize);
     if (!stream->IsInitialized()) {
         delete stream;
         return E_FAIL;
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index e668b49..fae1883 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -302,10 +302,7 @@
     int result_width = pClipRect->Width();
     int result_height = pClipRect->Height();
     int result_pitch = (result_width + 3) / 4 * 4;
-    CFX_DIBitmap* pStretched = FX_NEW CFX_DIBitmap;
-    if (!pStretched) {
-        return NULL;
-    }
+    CFX_DIBitmap* pStretched = new CFX_DIBitmap;
     if (!pStretched->Create(result_width, result_height, FXDIB_8bppRgb)) {
         delete pStretched;
         return NULL;
@@ -1164,10 +1161,7 @@
         if (args.memory_size == 0 || !args.memory_base) {
             return NULL;
         }
-        pStream = FX_NEW GpStream;
-        if (!pStream) {
-            return NULL;
-        }
+        pStream = new GpStream;
         pStream->Write(args.memory_base, (ULONG)args.memory_size, NULL);
         status = CallFunc(GdipCreateBitmapFromStreamICM)(pStream, &pBitmap);
     }
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index 9e7a0aa..7dc48a1 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -143,13 +143,7 @@
     CPDF_FixedMatrix result2src_fix(result2src, 8);
     int result_width = result_rect.Width();
     int result_height = result_rect.Height();
-    CFX_DIBitmap* pTempBitmap = FX_NEW CFX_DIBitmap;
-    if (!pTempBitmap) {
-        if (pSrcBitmap != src_bitmap) {
-            delete pSrcBitmap;
-        }
-        return NULL;
-    }
+    CFX_DIBitmap* pTempBitmap = new CFX_DIBitmap;
     if (!pTempBitmap->Create(result_width, result_height, pSrc->GetFormat())) {
         delete pTempBitmap;
         if (pSrcBitmap != src_bitmap) {
@@ -291,10 +285,7 @@
     m_Width = ::GetDeviceCaps(m_hDC, HORZRES);
     m_Height = ::GetDeviceCaps(m_hDC, VERTRES);
     m_nBitsPerPixel = ::GetDeviceCaps(m_hDC, BITSPIXEL);
-    m_pPSOutput = FX_NEW CPSOutput(hDC);
-    if (!m_pPSOutput) {
-        return FALSE;
-    }
+    m_pPSOutput = new CPSOutput(hDC);
     ((CPSOutput*)m_pPSOutput)->Init();
     m_PSRenderer.Init(m_pPSOutput, pslevel, m_Width, m_Height, bCmykOutput);
     m_bCmykOutput = bCmykOutput;