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

Petr Pchelko petr.pchelko at oracle.com
Tue Jun 17 12:43:34 UTC 2014

Hello, AWT Team.

Please review the fix for the issue:
The fix is available at:

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