[kdev 4] isn't this dangerous?

Alexander Dymo dymo at ukrpost.ua
Fri Apr 20 19:08:32 UTC 2007


On 4/20/07, Andras Mantia <amantia at kde.org> wrote:
> On Friday 20 April 2007, Andreas Pakulat wrote:
> > Well, if the dynamic_cast fails the plugin won't work and from the
> > plugin destructor I don't think we can abort the plugin creation (or
> > can we?).
> I don't know, but having a null pointer (for d->core) instead of an
> invalid pointer is still better, IMO. If it ever happens that parent is
> not a KDevelop::ICore, for null pointer it will crash at first access,
> but with the invalid pointer who knows what will happen.
Can anybody please explain what's wrong with static cast here?




More information about the KDevelop-devel mailing list