[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ Plugins and virtual destructors.

From: Ralf Wildenhues
Subject: Re: C++ Plugins and virtual destructors.
Date: Sun, 11 Nov 2007 14:16:00 +0100
User-agent: Mutt/1.5.17 (2007-11-04)

Hello Brendon,

* Brendon Costa wrote on Fri, Nov 09, 2007 at 03:20:27AM CET:
> Is using virtual destructors fine with a C++ plugin interface?

Good question.

> I have an example below that works.

Means you've got it to work with which set of compilers on what list of

> However i am not sure if it is a
> good practice. In particular is it ok to make use of virtual
> destructors in an application to destroy an object allocated in the
> plugin or should I define a pure virtual Destroy() method to ensure
> that the actual memory de-allocation (call to delete) is performed in
> the plugin where it was also initially allocated?

I don't know either.  But if it helps you, we can put your example in
the Libtool HEAD testsuite, to get some test exposure.  It should be
removed of the GCC attributes, the iostream dependency, and use
old-style casts (the last two are merely to avoid bogus errors on
pre-iso C++ compilers).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]