[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] CR 6974985 Redispatched, P3 java/classes_2d Jave2Demo threw exceptions when xrender
From:       linuxhippy () gmail ! com (Clemens Eisserer)
Date:       2010-09-24 21:55:28
Message-ID: AANLkTi=UeOzBOcYSu+AtMk72y95Z_D7Ti=e38wBscUeL () mail ! gmail ! com
[Download RAW message or body]

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
code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freepictfix1.patch
Type: text/x-patch
Size: 4551 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20100924/a8c1295d/attachment.bin 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic