changeset 13770:c50a78763e19

7175183: [macosx] Objective-C exception thrown when switching monitor configuration Reviewed-by: prr, serb
author kizune
date Thu, 06 Sep 2012 14:59:54 +0400
parents 776ac504ea9b
children 77ca6d7c53d2
files jdk/src/share/classes/sun/awt/image/VolatileSurfaceManager.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Wed Sep 05 17:33:52 2012 -0700
+++ b/jdk/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Thu Sep 06 14:59:54 2012 +0400
@@ -333,11 +333,12 @@
             // using a SurfaceData that was created in a different
             // display mode.
             sdBackup = null;
-            sdCurrent = getBackupSurface();
             // Now, invalidate the old hardware-based SurfaceData
+            // Note that getBackupSurface may set sdAccel to null so we have to invalidate it before
             SurfaceData oldData = sdAccel;
             sdAccel = null;
             oldData.invalidate();
+            sdCurrent = getBackupSurface();
         }
         // Update graphicsConfig for the vImg in case it changed due to
         // this display change event