问题
In IBM Rhapsody if i have created instance of a class using new, then Do we have to take care for deallocating memory by calling delete or Termination Connector will handle its destruction with memory deallocation in its State Diagram??
回答1:
If you are using C++ and the OXF (Object Execution Framework), then rather than calling delete
, you should call destroy()
on the object you want to delete.
Example:
C *c = new C();
// cleanup
c->destroy();
Note: Deleting an OMReactive
object while the OXF is running is not a good idea. The OXF might try to dispatch an event to the object that does not exist anymoremore.
来源:https://stackoverflow.com/questions/26626872/understanding-on-termination-connector-of-state-diagram-in-ibm-rhapsody