Permalink
Browse files

fixed problem where parts of r shutdown were called twice

  • Loading branch information...
Aarong93 committed Oct 12, 2011
1 parent 2363b1f commit 526ed27489fdf82faed2ff27f11629d44ed73671
Showing with 5 additions and 14 deletions.
  1. +0 −10 ext/rsruby.c
  2. +5 −4 test/test_memory_usage.rb
View
@@ -99,16 +99,6 @@ void r_finalize(void)
char * tmpdir;
R_dot_Last();
R_RunExitFinalizers();
CleanEd();
Rf_KillAllDevices();
if((tmpdir = getenv("R_SESSION_TMPDIR"))) {
snprintf((char *)buf, 1024, "rm -rf %s", tmpdir);
R_system((char *)buf);
}
PrintWarnings(); /* from device close and .Last */
R_gc(); /* Remove any remaining R objects from memory */
}
@@ -1,8 +1,9 @@
require 'rsruby'
10000.times do |n|
puts n
RSRuby.instance.eval_R("x#{n} = c(1:1000000)")
RSRuby.instance.shutdown
a = RSRuby.instance.parse(:text =>"x#{n} = c(1:1000000);")
RSRuby.instance.eval(a)
#RSRuby.instance.eval_R("x#{n} = c(1:1000000)")
end
RSRuby.instance.shutdown

0 comments on commit 526ed27

Please sign in to comment.