<AWT Dev> [9] Review Request: 8047061 [macosx] Crash when setting display mode

Anthony Petrov anthony.petrov at oracle.com
Tue Jun 17 13:51:31 UTC 2014


Hi Petr,

The fix looks fine to me.

--
best regards,
Anthony

On 6/17/2014 4:43 PM, Petr Pchelko wrote:
> Hello, AWT Team.
>
> Please review the fix for the issue:
> https://bugs.openjdk.java.net/browse/JDK-8047061
> The fix is available at:
> http://cr.openjdk.java.net/~pchelko/9/8047061/webrev/
>
> When we are searching through valid display modes we are storing them in an array. Before the fix we were passing NULL
> CFArrayCallbacks structure making an array of weak references.  (the CFArrayCallbacks is a structure of the function pointers
> which are called to retain and release elements of the array) So we were relying on the fact that Carbon also retains the pointers
> we are using internally. But sometimes it's not the case. The solution is simple - pass default array callbacks structure to create
> an array of strong references which can be passed around.
>
> I've checked that no native memory leak is introduced with this change.
>
> With best regards. Petr.
>


More information about the awt-dev mailing list