Modeling Services > Rogue Wave Script Integration > Accessing Server Objects from Scripts > Life Cycle of Script Objects
 
Life Cycle of Script Objects
In the context of Rogue Wave® Server, a script proxy of a server object holds C++ objects through a smart pointer. When the function is completed, the proxy is released and the reference counter is decremented. The server object is then deleted if it is no longer held by any other smart pointer. (See Smart Pointers for more information on this feature.)
Example
function f() {
var d = new Domain("France");
}
In this example, because the new domain is not involved in a server relation within the Server model, it will be destroyed when the function quits. Note that if the object is stored in a dictionary or declared to the view server by a call to the member function IlsMvServer::DeclObjectLabel, it will be held by a smart pointer and, therefore, will not be destroyed.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.