changeset 4377:bcc961336f77

7042429: jdk 7 b140: crashes in awt.dll+0xb85fb] Java_sun_awt_Win32GraphicsEnvironment_isVistaOS+0xfdf Reviewed-by: bae, dcherepanov
author dav
date Wed, 11 May 2011 15:00:25 +0400
parents dde5cc0d768c
children 4a5bb1f16cb4
files src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp src/windows/native/sun/windows/Devices.h
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp	Tue May 10 18:28:05 2011 +0400
+++ b/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp	Wed May 11 15:00:25 2011 +0400
@@ -191,6 +191,14 @@
     pMgr = D3DPipelineManager::GetInstance();
     RETURN_IF_NULL(pMgr);
     hMon = pMgr->pd3d9->GetAdapterMonitor(adapter);
+
+    /*
+     * If we don't have devices initialized yet, no sense to clear them.
+     */
+    if (!Devices::GetInstance()){
+         return;
+    }
+
     gdiScreen = AwtWin32GraphicsDevice::GetScreenFromHMONITOR(hMon);
 
     JNU_CallStaticMethodByName(env, NULL,
--- a/src/windows/native/sun/windows/Devices.h	Tue May 10 18:28:05 2011 +0400
+++ b/src/windows/native/sun/windows/Devices.h	Wed May 11 15:00:25 2011 +0400
@@ -36,6 +36,7 @@
 class Devices {
 
 public:
+static Devices*                 GetInstance();
 static BOOL                     UpdateInstance(JNIEnv *env);
        int                      GetNumDevices() { return numDevices; }
        AwtWin32GraphicsDevice*  GetDeviceReference(int index, BOOL adjust = TRUE);
@@ -59,7 +60,6 @@
 private:
                                 Devices(int numElements);
        void                     AddReference();
-static Devices*                 GetInstance();
 
        AwtWin32GraphicsDevice** devices;
        int                      refCount;