[gmpi] Re: Linux C++ question

On Wed, Feb 23, 2005 at 02:28:33PM -0800, Tim Hockin wrote:
> On Thu, Feb 24, 2005 at 11:26:49AM +1300, Jeff McClintock wrote:
> > > It blows up after the final return of main.  What I suspect is that the
> > > GMPI_Factory destructor is being called, but the DLL is already unloaded.
> > 
> > Does putting a printf("Factory destructor..  int the destructor provide 
> > more info (may have to provide a destructor, I didn't)?

I provided a destructor for GMPI_Factory.  If I call GMPI_DllClose()
before exiting from main(), then I get a segfault.  If I don't call
DllClose, the GMPI_Factory destructor DOES run.

If I don't provide a destructor, it fails to load the DLL:
undefined symbol: _._12GMPI_Factory

So I made the Factory instance use new and delete and actually be
refcounted.

Problem gone.  I'll post all the code as soon as I have assured myself
that both the C and C++ are correct.  Like I said - I'm learning some C++
as I go :)  Google is a good teacher.

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