From reading the documentation for c++ clients I got the impression that assignment would work automagicaly with the reference counting behind the scenes. So it was somewhat surprising to see this eat up memory rather fast.
Code: Select all
polymake::Main m;
m.set_application("polytope");
pm::perl::Scope s = m.newScope();
pm::perl::Object p;
while(1){
CallPolymakeFunction("rand_sphere", 20, 200) >> p;
}
Shouldn't the memory for the old polytope be freed each loop iteration or am I misusing perl::Objects here?
I have another totally unrelated question. How can I use the return value of a script from the callable library? I tried
Code: Select all
CallPolymakeFunction("script", "/pathtoscript/simple.pl") >> p;
with a trivial script like
Code: Select all
use application "polytope";
cube(3);
but accessing any of p's attributes will result in a "Can't call method "type" on an undefined value" exception at runtime.