>>> If this is the C API, couldn't the C++ API be made so that the Destroy() method is actually the destructor? <<< The way you do that is like this: void CFoo::Destroy() { delete this; } But it assumes CFoo was allocated on the heap via "new CFoo". -----Original Message----- From: gmpi-bounce@xxxxxxxxxxxxx [mailto:gmpi-bounce@xxxxxxxxxxxxx] On Behalf Of Tim Hockin Sent: Monday, February 14, 2005 4:17 PM To: gmpi@xxxxxxxxxxxxx Subject: [gmpi] Re: low level API - Abstract Factory summary On Mon, Feb 14, 2005 at 03:50:11PM -0500, Ron Kuper wrote: > If an object destroys itself then the method should probably have no > args: > > struct GMPI_Object > { > GMPI_RESULT GetInterface( UUID interfaceID, void** obj ) = 0; > GMPI_RESULT Destroy() = 0; > }; > > The only qualm I have with this approach is that the object needs to > write code that says "delete this". I am still shocked when I see > suicidal objects. If this is the C API, couldn't the C++ API be made so that the Destroy() method is actually the destructor? ---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission. Archive: //www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe ---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission. Archive: //www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe