Deallocates a JSON Entity from memory.

Syntax

Result = SRP_Json(Handle, "Release")

Returns

Returns 1 if successful, 0 if not.

Parameters

ParameterDescription
HandleHandle to a JSON Entity. Required.

Remarks

The Release service removes a JSON entity from memory. Once Released, it is no longer valid. In fact, the Release service sets Handle to 0 to ensure the old handle will not be used accidentally. Any JSON entity created by the New or Parse services must be deallocated from memory when no longer needed. Forgetting to do this on occasion will not cause a fatal error since SRP Utilities will clean up all its memory when OpenInsight closes, but frequently failing to Release entities causes memory to get used up, which can become a problem over long periods of time.

Example

// Let's create some entities.
Success = SRP_Json(ObjectHandle, "New", "Object")
Success = SRP_Json(IntegerHandle, "New", "Number", "1234567890")
Success = SRP_Json(DecimalHandle, "New", "Number", "123456789.987654321")
Success = SRP_Json(StringHandle, "New", "String", "Hello, World!")
Success = SRP_Json(BooleanHandle, "New", "Boolean", 1)
Success = SRP_Json(ArrayHandle, "New", "Array")

// Don't forget to Release them when we're done
SRP_Json(ArrayHandle, "Release")
SRP_Json(BooleanHandle, "Release")
SRP_Json(StringHandle, "Release")
SRP_Json(DecimalHandle, "Release")
SRP_Json(IntegerHandle, "Release")
SRP_Json(ObjectHandle, "Release")

See Also

NewParse

  • No labels