[gmpi] Re: Linux C++ question

  • From: "Ron Kuper" <ronkuper@xxxxxxxxxxx>
  • To: <gmpi@xxxxxxxxxxxxx>
  • Date: Tue, 1 Mar 2005 21:38:59 -0500

     SomeObject* foo_is_a_singleton = 0;

     void
     the_foobar_plugin_instantiator () {
          if (!foo_is_a_singleton) {
       foo_is_a_singleton = new SomeObject();
          }
   ... the rest ...
     }

This introduces a memory leak. You need to clean up the singleton on exit.


---------------------------------------------------------------------- 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

Other related posts: