7048568: Crash in Java_sun_awt_Win32GraphicsEnvironment_isVistaOS
authordav
Tue, 07 Jun 2011 22:58:24 +0400
changeset 9821 359a643a641b
parent 9778 967402e4be8b
child 9822 8041d9891573
7048568: Crash in Java_sun_awt_Win32GraphicsEnvironment_isVistaOS Reviewed-by: dcherepanov, art, amenkov
jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp
--- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Thu Jun 02 13:38:28 2011 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Tue Jun 07 22:58:24 2011 +0400
@@ -673,6 +673,12 @@
  */
 void AwtWin32GraphicsDevice::ResetAllMonitorInfo()
 {
+    //IE in some circumstances generates WM_SETTINGCHANGE message on appearance
+    //and thus triggers this method
+    //but we may not have the devices list initialized yet.
+    if (!Devices::GetInstance()){
+        return;
+    }
     Devices::InstanceAccess devices;
     int devicesNum = devices->GetNumDevices();
     for (int deviceIndex = 0; deviceIndex < devicesNum; deviceIndex++) {