[OpenJDK 2D-Dev] CR 6974985 Redispatched, P3 java/classes_2d Jave2Demo threw exceptions when xrender enabled in OEL5.5

Clemens Eisserer linuxhippy at gmail.com
Fri Sep 24 21:55:28 UTC 2010

Hi Phil,

> It doesn't sound right to me that this behaviour is an implementation detail of X.org.
> Developers need to know that either it does or it doesn't. Were you given a
> good rationale?

The explanation was that Pixmaps are reference counted, and therefor
stay alive if a XRender-picture points to it. A window is not
reference counted, and therefor all its resources are destroyed
immediatly. GC's are not affected because they are not bound to a
drawable, thats why it hasn't been a problem for the JDK to free GCs
later than the Window.
I find this explanation fishy, but the general recommendation was to
free Pictures before the drawable in any case.

The patch attached does free the picture before destroying the window,
however casting surfaceData to XRSurfaceData in XWindow.java is ugly -
and the patch assumes nobody calls XDestroyWindow for a
SurfaceData-Drawable except destroy(). Suggestions welcome ;)

With that patch I get rid of all XErrors and also can't reproduce the
XDnD-Exception anymore.

> I don't see how that helped on its own. If the Picture is implicitly freed
> by XDestroyWindow then
> xsdo->xrPic is still going to be != None .. or am I overlooking something?

My initial analysis was wrong - somehow I thought the problem is
solved, but it wasn't.

Thanks Clemens

PS: Is there some java-side equivalent in SurfaceData for X11SD_Dispose?
I have a GC on the java side with no references on the native side and
if possible would like to free it at dispose time without writing C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freepictfix1.patch
Type: text/x-patch
Size: 4552 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20100924/a8c1295d/freepictfix1.patch>

More information about the 2d-dev mailing list