Re: RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources [v2]

2023-07-28 Thread Alexey Ivanov
On Fri, 28 Jul 2023 08:02:22 GMT, Matthias Baesken wrote: >> src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp line 207: >> >>> 205: ::DeleteDC(hdcScreen); >>> 206: throw std::bad_alloc(); >>> 207: } >> >> I wonder if we can catch `std::bad_alloc` to release the r

Re: RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources [v2]

2023-07-28 Thread Matthias Baesken
On Thu, 27 Jul 2023 19:57:01 GMT, Alexey Ivanov wrote: >> Matthias Baesken has updated the pull request incrementally with one >> additional commit since the last revision: >> >> adjust checks and calculation of numPixels > > src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp line 2

Re: RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources [v2]

2023-07-27 Thread Alexey Ivanov
On Wed, 26 Jul 2023 11:59:06 GMT, Matthias Baesken wrote: >> In src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels >> we release some resources at the end of the function by calling >> DeleteObject/DeleteDC. This is recommended by the MS API docs. >> However this should b

Re: RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources [v2]

2023-07-26 Thread Matthias Baesken
On Wed, 26 Jul 2023 11:59:06 GMT, Matthias Baesken wrote: >> In src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels >> we release some resources at the end of the function by calling >> DeleteObject/DeleteDC. This is recommended by the MS API docs. >> However this should b

Re: RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources [v2]

2023-07-26 Thread Matthias Baesken
> In src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels > we release some resources at the end of the function by calling > DeleteObject/DeleteDC. This is recommended by the MS API docs. > However this should be done as well in some early leaving with throw that can > occu

Re: RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources

2023-07-26 Thread Thomas Stuefe
On Wed, 26 Jul 2023 10:43:20 GMT, Matthias Baesken wrote: > In src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels > we release some resources at the end of the function by calling > DeleteObject/DeleteDC. This is recommended by the MS API docs. > However this should be do

Re: RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources

2023-07-26 Thread Matthias Baesken
On Wed, 26 Jul 2023 10:43:20 GMT, Matthias Baesken wrote: > In src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels > we release some resources at the end of the function by calling > DeleteObject/DeleteDC. This is recommended by the MS API docs. > However this should be do

RFR: JDK-8313164: src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels adjust releasing of resources

2023-07-26 Thread Matthias Baesken
In src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp GetRGBPixels we release some resources at the end of the function by calling DeleteObject/DeleteDC. This is recommended by the MS API docs. However this should be done as well in some early leaving with throw that can occur in this