[gmpi] Re: Linux C++ question

When does that object get deleted?

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: http://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: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: