diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-02-26 03:22:44 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-02-26 03:22:44 -0800 |
commit | 1e34a4f02e8f3743cf4d27117ccaf083a83b4d1f (patch) | |
tree | a9d54dc85328c0a5841a1eac18d6607dbbf84202 /lib/rainbows/fiber/io.rb | |
parent | d6be7785ee6abf35001a0e7b655a6f64b7c7733f (diff) | |
download | rainbows-1e34a4f02e8f3743cf4d27117ccaf083a83b4d1f.tar.gz |
For the very rare apps out there using Rainbows::Fiber::IO, the FiberSpawn and FiberPool (but not RevFiberSpawn) models could leak memory if the app-created Rainbows::Fiber::IO objects were dereferenced without being removed from the RD/WR hashes.
Diffstat (limited to 'lib/rainbows/fiber/io.rb')
-rw-r--r-- | lib/rainbows/fiber/io.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rainbows/fiber/io.rb b/lib/rainbows/fiber/io.rb index 339ac0a..5153070 100644 --- a/lib/rainbows/fiber/io.rb +++ b/lib/rainbows/fiber/io.rb @@ -19,7 +19,9 @@ module Rainbows end def close - to_io.close + RD.delete(self) + WR.delete(self) + to_io.close unless to_io.closed? end def wait_readable |