IBM Rhapsody中状态图终止连接器的理解 [英] Understanding on Termination Connector of State Diagram in IBM Rhapsody
问题描述
在 IBM Rhapsody 中,如果我使用 new 创建了一个类的实例,那么我们是否需要注意通过调用 delete 来释放内存,或者 Termination Connector 将在其状态图中通过内存释放来处理它的销毁??
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??
推荐答案
如果您使用的是 C++ 和 OXF(对象执行框架),那么与其调用 delete
,不如调用 destroy()
在要删除的对象上.
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.
示例:
C *c = new C();
// cleanup
c->destroy();
注意:在 OXF 运行时删除 OMReactive
对象不是一个好主意.OXF 可能会尝试向不再存在的对象分派事件.
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.
这篇关于IBM Rhapsody中状态图终止连接器的理解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!