Platform Package reference: Function _LockObject()

Description of the function _LockObject() available in all Platform Packages for WebGL JavaScript compatible target systems. This function is intended to be used when integrating the Embedded Wizard created GUI application with the underlying graphics subsystem, graphics hardware or other external GUI applications coexisting on the same system.

Declaration

function _LockObject( aObject )

Parameters

aObject

The object which should be protected from being discarded by the garbage collection.

Discussion

The function _LockObject() adds the given object aObject to a global root set. Objects, which are stored in the root set will still keep alive together with other objects depending on them. For example:

var someObject = ... EmWiApp._LockObject( someObject );

Objects, which are not stored in the root set and not referenced by any other object stored in the root set are garbage and will be released during the next garbage collection invocation. To remove again a previously locked object from the root set use the function _UnlockObject().