changeset 5305:69e3d576a37a

7175183: [macosx] Objective-C exception thrown when switching monitor configuration Reviewed-by: prr, art
author kizune
date Fri, 07 Sep 2012 22:16:17 +0400
parents 0fa8d5080fd8
children f94f01ee84b7
files src/share/classes/sun/awt/image/VolatileSurfaceManager.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Fri Sep 07 08:22:15 2012 -0700
+++ b/src/share/classes/sun/awt/image/VolatileSurfaceManager.java	Fri Sep 07 22:16:17 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