View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > ReleaseComObject PreviousNext

ReleaseComObject

Releases a COM Object and frees up resources that it used.

Nothing.

Extensibility functions

ReleaseComObject(objectName)

CreateObject, cfobject

ColdFusion MX 6.1: Added this function.

Parameter

Description

objectName

Variable name of a COM object that was created using the CreateObject function or cfobject tag.

This function forcefully terminates and releases the specified COM object and all COM objects that it created. Use this function when the object is no longer in use, to quickly free up resources. If the COM object has a method, such as a quit method, that terminates the program, call this method before you call the ReleaseComObject function.

This function can improve processing efficiency, but is not required for an application to work. If you do not use this function, the Java garbage collection mechanism eventually frees the resources. If you use this function on an object that is in use, the object is prematurely released and your application will get exceptions.

<h3>ReleaseComObject Example</h3>
   <cfscript>
   obj = CreateObject("Com", "excel.application.9");
   //code that uses the object goes here
   obj.quit();
   ReleaseObject(obj);
   </cfscript>

Contents > CFML Reference > ColdFusion Functions > ReleaseComObject PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


sthompson said on Aug 5, 2003 at 2:17 PM :
The example code calls ReleaseObject(obj); when the function name is ReleaseComObject.
adamscreek said on May 14, 2004 at 1:49 PM :
ditto...syntax error on function in example!

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa65.htm