[windows] IO#tty? leaks C runtime descriptors
---------------------------------------------
Key: JRUBY-4152
URL: http://jira.codehaus.org/browse/JRUBY-4152
Project: JRuby
Issue Type: Bug
Components: Windows
Affects Versions: JRuby 1.4.0RC2, JRuby 1.5
Reporter: Vladimir Sizikov
IO.tty? uses WindowsPOSIX's isatty() method which creates the C runtime
descriptors, but never frees them, so they are being leaked.
Consider the following test:
{code}
p $stdin.tty?
10_000.times {
$stdin.tty?
}
p $stdin.tty?
{code}
JRuby would produce true and then false.
*NOTE*: Closing the descriptor right in isatty() is also wrong, since closing
it would also close the associated file descriptor, thus making the particular
IO instance unusable.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email