Howto:Extend Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 206: Line 206:


= Things to avoid =  
= Things to avoid =  
And just for completeness: things get *really* complicated if you need to *store* a naRef you got from a Nasal script in a place where the interpreter can't see it. There is a minimal API to handle this (naSave()), but it doesn't have a corrresponding call to release a saved object.  Just don't do this, basically.  Always keep your Nasal data in Nasal space.
And just for completeness: things get *really* complicated if you need to *store* a naRef you got from a Nasal script in a place where the interpreter can't see it.
 
There is a minimal API to handle this:
 
// "Save" this object in the context, preventing it (and objects
// referenced by it) from being garbage collected.
void naSave(naContext ctx, naRef obj);
 
 
But this API doesn't yet have a corresponding call to release a saved object.   
Just don't do this, basically.  Always keep your Nasal data in Nasal space.




[[Category:Nasal]]
[[Category:Nasal]]
[[Category:Core Documentation]]
[[Category:Core Documentation]]
2,561

edits

Navigation menu