-
Notifications
You must be signed in to change notification settings - Fork 37
Common mistakes
SilverIce edited this page Sep 3, 2016
·
7 revisions
Don't release an object without zeroing its identifier, especially if jobjectId is a field in a script (and not some local variable). This leaves dangling object identifier. When the object pointed by jobjectId identifier will be deleted, the identifier (the number itself) may be reused (after some time) for a new object created elsewhere, and jobjectId will point to that new object.
JValue.release(jobjectId)The sample below is valid. In case jobjectId is a field, it's best to use properties and JValue.releaseAndRetain to encapsulate/hide release & retain operation as shown in Lifetime Management.
jobjectId = JValue.release(jobjectId)Sign into GitHub and press Edit at the top to add any missing information or fix typos and errors. Thanks!