RFR: 8284093: Memory leak: X11SD_DisposeXImage should also free obdata

Andrew John Hughes andrew at openjdk.java.net
Mon Apr 11 13:36:51 UTC 2022


On Thu, 31 Mar 2022 13:30:40 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> Please review this small patch to fix leaking `XShmSegmentInfo` that is attached to `XImage`. 
> 
> Test:
> 
> - [x] jdk_2d

This looks correct to me.

There is another similar block:

        if (xsdo->shmPMData.shmSegInfo != NULL) {
            X11SD_DropSharedSegment(xsdo->shmPMData.shmSegInfo);
            xsdo->shmPMData.shmSegInfo = NULL;
        }

But `xsdo->shmPMData.shmSegInfo` is assigned `img->obdata` in `X11SD_CreateSharedPixmap`, so looks like this is the one and only place to free this.

-------------

Marked as reviewed by andrew (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8060



More information about the client-libs-dev mailing list