PDA

View Full Version : Destroy() function on XAObjectItf



rajv
06-18-2008, 04:37 AM
From the state diagram on page 15 of OpenMaxAL specs verion 1.0, it says Destroy() implicitly transfers the object through the Unrealized state(see page 224). As per state diagram there shall be a path from Unrealized state to Realize state. Of course this has to be done using Realize() which is contradicting. This can be ignored as it says Destroy() 'implicitly' transfers.
(b) but on page 14.
Unrealized (initial state): The 'object is alive'(what does this mean then?) but has not allocated resources. It is not yet usable; its interfaces’ methods cannot yet be called.

Could someone clarify this state transition during the destruction of an object?

Matti
03-27-2009, 03:08 PM
After its destruction, the state of the object is undefined. This is described in Destroy method's definition: "All references to interfaces belonging to this object become invalid and may cause undefined behavior if used." Also the state of the object after its destruction is undefined.

There is a small typo in Destroy method's description:
"Destroy implicitly transfers the object to Unrealized state, thus freeing any resources allocated to the object prior to freeing it."
should be
"Destroy implicitly transfers the object through Unrealized state, thus freeing any resources allocated to the object prior to freeing it."
We will fix this for the final 1.0 release.

BR,
Matti