From 352ac2efdf825864335cd31e56fdda7352bb6a1a Mon Sep 17 00:00:00 2001 From: toddaaro Date: Tue, 20 Aug 2013 15:33:20 -0700 Subject: Fixed a memory leak caused by the singleton idle callback failing to close correctly. The problem was that the close function requires running inside a callback in the event loop, but we were trying to close the idle watcher after the loop returned from run. The fix was to just call run again to process this callback. There is an additional tweak to move the initialization logic fully into bootstrap, so tasks that do not ever call run do not have problems destructing. --- src/libstd/rt/uv/uvio.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd/rt/uv') diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs index 290e57942f4..9942ed330c4 100644 --- a/src/libstd/rt/uv/uvio.rs +++ b/src/libstd/rt/uv/uvio.rs @@ -176,7 +176,7 @@ impl UvPausibleIdleCallback { self.pause(); if !self.closed { self.closed = true; - self.watcher.close(||()); + self.watcher.close(||{}); } } } -- cgit 1.4.1-3-g733a5