<AWT Dev> RFR: 8181139: Memory leak in awt_Font.cpp / AwtFont::Create

semyon.sadetsky at oracle.com semyon.sadetsky at oracle.com
Thu Nov 9 00:55:14 UTC 2017

Should not it be deleted in the catch block as well?


On 11/8/17 4:13 PM, Philip Race wrote:
> Bug: https://bugs.openjdk.java.net/browse/JDK-8181139
> Webrev : http://cr.openjdk.java.net/~prr/8181139/
> if we aren't using / returning the awtFont C object we should free 
> (delete) it before returning
> to avoid a leak in this theoretical situation.
> The object has only just been allocated and doesn't have any clean up 
> that needs to be
> done besides calling its C++ destructor.
> [NB sending to awt-dev, not 2d-dev since this C++ Windows-specific 
> class is used only to
> support Composite Logical Fonts on AWT GDI heavyweights .. ]
> -phil.

More information about the awt-dev mailing list