Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The RELEASE service removes an instantiated object from memory. When you use the CREATE service service to create objects, the GET service to get objects, or the CALL services for functions that return objects, they are loaded into memory and remain there until you either release the object using the RELEASE service or until OI closes down. Don't worry if If you forget to call this service; SRP_Com will clean up whatever is left.That being said, if you plan to instantiate a lot of objects, leaving them in memory over a long period of time can degrade performance, but it is best practice to release every object you create or get to avoid memory issues.

Example

Code Block
// Instantiate the MSXML DOM Document object
If SRP_Com(objXmlDoc, "CREATE", "Msxml2.DOMDocument") then
    // Release the object when we're done with it
    SRP_Com(objXmlDoc, "RELEASE")
end else
    Error = SRP_Com("", "ERROR")
end

 

...