[OpenJDK 2D-Dev] RFR: 8241829 Cleanup the code for PrinterJob on windows

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Sun Apr 5 01:40:25 UTC 2020


Hello,

Here is an updated patch:
http://cr.openjdk.java.net/~serb/8241829/webrev.02

Some thoughts about the patch:
  - The memory leak mentioned before is not really critical. It has
    occurred only if some exception is happening, otherwise, the
    loop worked till the end of the JVM, because this is infinite
    loop on the daemon thread.

  - The old loop tried to catch SecurityException which as far as I
    understand cannot be happen, since the thread has all permission(it is
    started in the doPriv block). The similar loop for remote printers
    does not have such "catch SecurityException" as well.

  - I have re-implement the loop in the native code and mimic the old
    behavior, and this highlight some other issues: Should we exit when
    java exception occur, should we exit if "FindNextPrinterChangeNotification"
    or "WaitForSingleObject" return some errors? The example in the msdn
    does not exit in such cases[1].

[1] https://docs.microsoft.com/en-us/windows/win32/printdocs/findnextprinterchangenotification

On 4/2/20 12:09 pm, Sergey Bylokhov wrote:
> On 4/2/20 12:00 pm, Philip Race wrote:
>>
>> Are we leaking the handle ?  Looks that way to me ..


-- 
Best regards, Sergey.


More information about the 2d-dev mailing list