On Fri, Feb 25, 2005 at 10:09:14AM +1300, Jeff McClintock wrote: > When does that object get deleted? When the refcount hits 0. It doesn't have to be function-scoped, it could easily be file scoped, so the ::Release method has direct access. > >I don't see how those two are related? It's easy enough to share things > >between instances. Whether an object is truly static or is just wrapped > >up doesn't matter. > > > >Consider (roughly from GMPI factory) > > > > GMPI_Factory* Factory(void) > > { > > static GMPI_Factory the_factory; > > return &the_factory; > > } > > > >vs > > > > GMPI_Factory* Factory(void) > > { > > static GMPI_Factory* the_factory; > > if (the_factory == NULL) { > > the_factory = new GMPI_Factory(); > > } > > return the_factory; > > } > > > > > >The overhead is a branch. > > > >---------------------------------------------------------------------- > >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 -- Tim Hockin thockin@xxxxxxxxxx Soon anyone who's not on the World Wide Web will qualify for a government subsidy for the home-pageless. ---------------------------------------------------------------------- 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