2,561
edits
Line 245: | Line 245: | ||
But this API doesn't yet have a corresponding call to release a saved object. | 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. | ||
Just don't do this, basically. Always keep your Nasal data in Nasal space. | |||
In FlightGear however, you may want to check out the gcSave/gcRelease methods of the FGNasalSys class: | |||
// This mechanism is here to allow naRefs to be passed to | |||
// locations "outside" the interpreter. Normally, such a | |||
// reference would be garbage collected unexpectedly. By passing | |||
// it to gcSave and getting a key/handle, it can be cached in a | |||
// globals.__gcsave hash. Be sure to release it with gcRelease | |||
// when done. | |||
int gcSave(naRef r); | |||
void gcRelease(int key); | |||
[[Category:Nasal]] | [[Category:Nasal]] | ||
[[Category:Core Documentation]] | [[Category:Core Documentation]] |
edits