This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 127558

Summary: Output window output stream not closed
Product: versioncontrol Reporter: _ tboudreau <tboudreau>
Component: MercurialAssignee: issues@versioncontrol <issues>
Status: RESOLVED FIXED    
Severity: blocker CC: msandor
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: proposed patch

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.