Hi, Dmitry.
Can you please review a simplified version of the fix.

The "javaPlatformWindow" is declared in AWTWindow.h this way:
   @property (nonatomic, retain) JNFWeakJObjectWrapper *javaPlatformWindow;

So it is not necessary to release it manually and just assigned to nil is 
enough.

http://cr.openjdk.java.net/~serb/8215756/webrev.01/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m.sdiff.html


On 21/12/2018 10:33, Dmitry Markov wrote:
Hi Sergey,

The fix looks good to me.

Thanks,
Dmitry

On 21 Dec 2018, at 00:20, Sergey Bylokhov <sergey.bylok...@oracle.com> wrote:

Hello.
Please review the fix for jdk 13.

Bug: https://bugs.openjdk.java.net/browse/JDK-8215756
Webrev: http://cr.openjdk.java.net/~serb/8215756/webrev.00

Two memory leaks were fixed:

- AWTView.m: we should release the NSTrackingArea, usually we do this
       when we change NSTrackingArea from one to another:
       
http://hg.openjdk.java.net/jdk/jdk/file/3791fee4df3b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m#l437
       But we also need to do this when the window is deallocated
- AWTWindow.m: We have a JNFWeakJObjectWrapper which holds the reference to the 
java object,
       when the window is deallocated we clear the reference to the java 
object, but
       we also need to release the JNFWeakJObjectWrapper object itself

I have checked by the Instruments that the test attached to the bug will not 
produce any other leaks after the fix.


--
Best regards, Sergey.



--
Best regards, Sergey.

Reply via email to