changeset 5230:8fcaac9ef213

Merge
author lana
date Wed, 21 Mar 2012 13:36:03 -0700
parents c373b5baa1e9 ba0afaab6ae8
children e7cc6c5a858c
files
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Thu Mar 15 15:17:02 2012 -0700
+++ b/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Wed Mar 21 13:36:03 2012 -0700
@@ -541,6 +541,8 @@
         J2dRlsTraceLn1(J2D_TRACE_ERROR,
                        "X11SD_SetupSharedSegment shmget has failed: %s",
                        strerror(errno));
+        free((void *)shminfo);
+        XDestroyImage(img);
         return NULL;
     }
 
@@ -550,6 +552,8 @@
         J2dRlsTraceLn1(J2D_TRACE_ERROR,
                        "X11SD_SetupSharedSegment shmat has failed: %s",
                        strerror(errno));
+        free((void *)shminfo);
+        XDestroyImage(img);
         return NULL;
     }
 
@@ -570,6 +574,9 @@
         J2dRlsTraceLn1(J2D_TRACE_ERROR,
                        "X11SD_SetupSharedSegment XShmAttach has failed: %s",
                        strerror(errno));
+        shmdt(shminfo->shmaddr);
+        free((void *)shminfo);
+        XDestroyImage(img);
         return NULL;
     }
 
@@ -1345,13 +1352,10 @@
 #ifdef MITSHM
         if (image->obdata != NULL) {
             X11SD_DropSharedSegment((XShmSegmentInfo*)image->obdata);
-        } else {
-            free(image->data);
+            image->obdata = NULL;
         }
-#else
-        free(image->data);
 #endif /* MITSHM */
-        XFree(image);
+        XDestroyImage(image);
     }
 }