delete SeExprVarRef in seop.cpp?

26 views
Skip to first unread message

Colin Doncaster

unread,
Jul 15, 2011, 4:03:57 PM7/15/11
to seexpr-...@googlegroups.com
Hi again -

I noticed in the seop.cpp example in the SeRmanExpr::resolveVar you're doing

AttrVar* attrVar = new AttrVar(/*td,*/name);

but never delete it anywhere. Is this intentional or am I misunderstanding what's happening?

cheers

brentb

unread,
Jul 18, 2011, 11:00:12 AM7/18/11
to seexpr-...@googlegroups.com
Hi Colin,

You're right that in the PRMan shadeop example the varrefs (and the exprs themselves for that matter) are allocated but never deleted.  We can get away with this in this case because the parsed expressions are cached for the life of the process in the expectation that they will be used over and over.  However,given that it's meant to be an instructive example, we should probably be doing proper cleanup.  Thanks for pointing it out.

Brent
Reply all
Reply to author
Forward
0 new messages