PDA

View Full Version : LuaCOM plugin ExitScript Error


genevangampelaere
04-29-2005, 08:26 AM
I'm evaluating TrueUpdate 2.0. I want to call a webservice in the server script. I'm using LuaCOM and the Soap Toolkit:

obj=luacom.CreateObject("MSSOAP.SoapClient");
Application.ExitScript();

When I call the ExitScript(); function I always get an error and windows (xp) closes the Update.exe.

What is wrong here ?

Brett
04-29-2005, 09:02 AM
Use this:

obj=luacom.CreateObject("MSSOAP.SoapClient");
obj=nil;
collectgarbage();
Application.ExitScript();

I lkearned this from the LuaCOM docs on their Web site:

3.2.1.0.1 Caution
LuaCOM only tracks references to COM objects. It does not work with the concepts of ``application'', ``component'', ``process'' etc. It does not know even which objects are part of the same component or application. This has some consequences on the object disposal:


a component may only consider as ``finished'' its relationship with LuaCOM when all references to its objects are released, not only the one created with CreateObject;
some components have a ``Quit'' method. This may close the component's interface, but it could remain running if there are any references to it. Nevertheless, these references cannot be reliably used after the ``Quit'' method has been called. To release the component, one must assign nil to all references to the component (and its sub-objects) and then call collectgarbage

genevangampelaere
04-29-2005, 09:30 AM
Thx for your fast reply ! It works!