Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 127558 - Output window output stream not closed
Output window output stream not closed
Status: RESOLVED FIXED
Product: versioncontrol
Classification: Unclassified
Component: Mercurial
6.x
All All
: P3 (vote)
: TBD
Assigned To: issues@versioncontrol
issues@versioncontrol
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-16 21:15 UTC by _ tboudreau
Modified: 2008-02-25 15:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments
proposed patch (3.09 KB, patch)
2008-02-25 15:16 UTC, Padraig Obriain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2008-02-16 21:15:12 UTC
After running Mercurial status, the command completes, but the output window's tab remains boldfaced.

This means you are not closing the output stream from the IOProvider you use to write to the output window.  Which means that the IOProvider handle will 
be retained for the life of the VM, and the memory mapped file you write to when you write to the output window will remain open and not be deleted on 
VM exit - even if the user closes the output tab.

You can always reopen the output stream;  and if you call IOProvider.getIO("Mercurial") every time you need to write output, you will be given the same 
output tab and IO instance unless the user has closed the window, in which case a new one will be created - but more importantly, everything associated 
with the previous output tab can garbage collected - but if, and only if, you close the output stream.

Please close the output stream when an operation completes.
Comment 1 Padraig Obriain 2008-02-18 13:31:31 UTC
I do not see that we are using IOProvider.getIO() to get an output stream to write to when running status.

Are you saying that we should call InputOutput.closeInputOutput() or OutputWriter.close() for the OutputWriters returned
by getOut() or getErr()
Comment 2 _ tboudreau 2008-02-19 18:34:11 UTC
OutputWriter.close().  IOProvider.closeInputOutput programmatically closes the output window tab.
Comment 3 Padraig Obriain 2008-02-20 08:56:42 UTC
Maros,

As far as I can see the same thing happens with Subversion. 
Do you know what is happening?
Comment 4 Maros Sandor 2008-02-20 09:08:21 UTC
OutputWriter.close() should be called whenever a command finishes.
Comment 5 Padraig Obriain 2008-02-25 11:45:44 UTC
I am seeing this problem when I invoke Diff.
Comment 6 Padraig Obriain 2008-02-25 15:16:40 UTC
Created attachment 57194 [details]
proposed patch
Comment 7 Padraig Obriain 2008-02-25 15:23:16 UTC
Patch pushed in e2c1d174791e.

As this is the only case I could find of the output window tab remaining boldfaced I am closing the bug.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo