libtool
[Top][All Lists]
Advanced

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

Re: C++ Plugins and virtual destructors.


From: Bob Friesenhahn
Subject: Re: C++ Plugins and virtual destructors.
Date: Sun, 11 Nov 2007 17:16:38 -0600 (CST)

On Mon, 12 Nov 2007, Brendon Costa wrote:

* As for exceptions, I have defined all the methods for the plugins
interface as throw() so exceptions may occur inside the plguin but may
not propagate from the plugin to the application. I honestly dont know
if exceptions occurring only within the plugin may cause any problems?

Hopefully you are aware of what throw() actually requests from the interface? Hint: It is a request to effectively crash if an attempt is made to throw an exception through that interface. It is possible to avoid a true crash, but only by implementing a traditional function with global scope.

The big question is if the C++ exception catching will work. Someone else here mentioned RTTI which is a fundamental facility needed for C++ exceptions since C++ exceptions are captured based on type. If the C++ exception handling does in fact work, then you can support the empty throw() contract by ensuring that all exceptions (e.g. failure of 'new') are caught and handled in some sane way.

May i ask what you mean by "properly mesh"? I was un-aware that C++
plugins which might use exceptions need to do anything in order to
make exceptions work (at least internally). It is something I have not
thought about.

I am not sure exactly. If the C++ support framework for the module needs to mesh with the overall C++ support framework, then I assume that it is compiler/OS dependent.

This topic is really interesting to me so I hope that someone with substantial cross-platform experience with this topic will chime in soon.

Bob
======================================
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/





reply via email to

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