diff options
| author | Graydon Hoare <[email protected]> | 2011-02-22 18:07:47 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-02-22 18:07:47 -0800 |
| commit | d7f7634c955deaf55cf11071d5e92300a059be61 (patch) | |
| tree | 6a41aa234c13500bd970ce56b1e77a388b485a38 /src | |
| parent | Add ABI tagging to crates, adjust rustc output and runtime stack-frame setup ... (diff) | |
| download | rust-d7f7634c955deaf55cf11071d5e92300a059be61.tar.xz rust-d7f7634c955deaf55cf11071d5e92300a059be61.zip | |
Drop for-loop temporary at end of scope, fixes memory leak.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp/middle/trans.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 4a672f49..6a19a6e5 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -2189,6 +2189,7 @@ fn trans_for(@block_ctxt cx, cx.build.Br(scope_cx.llbb); auto local_res = alloc_local(scope_cx, local); auto bcx = copy_ty(local_res.bcx, INIT, local_res.val, curr, t).bcx; + scope_cx.cleanups += clean(bind drop_slot(_, local_res.val, t)); bcx = trans_block(bcx, body).bcx; bcx.build.Br(next_cx.llbb); ret res(next_cx, C_nil()); |