Remove assertion in KDecorationUnstable's constructor.

Follow-up to c146941, which stopped exporting KDecorationBridgeUnstable.

The way the typeinfo and object comparisons are performed in a dynamic_cast
are not entirely defined in any ABI spec (or the C++ standard), and the
situation gets trickier when a hidden symbol (KDecorationBridgeUnstable)
gets passed between a program such as kwin or kcmshell4 and a dlopen()ed
library like kwin3_laptop.so: kwin is unaware of the symbol in
kwin3_laptop.so and vice-versa, so stricter implementations of the C++
runtime can choose to make the dynamic_cast call fail and return 0.

This was a source of crashes on GCC for a long time [1][2] until its
developers chose to make the typeinfo comparison in libstdc++ >= 4.5.x less
strict and just perform a string comparison of the type names by default.

[1] http://article.gmane.org/gmane.comp.gcc.patches/189813
[2] http://gcc.gnu.org/ml/gcc/2002-05/msg01970.html

It does not make things more correct, though, and after c146941 KWin started
crashing when built in debug mode and run with libcxxrt, another C++ runtime
implementation, since it performed a stricted typeinfo comparison by
default.

Simply removing the dynamic_cast should be fine: it is in an assertion, so
the code is not essential, and the assertion itself is not entirely correct.
Additionally, the assertion has already been removed from the master branch
in commit 4702bbd.

REVIEW:		113296
This commit is contained in:
Raphael Kubo da Costa 2013-10-17 01:09:03 +03:00
parent 07721aaab9
commit 92a4cdd9e7

View file

@ -434,7 +434,6 @@ bool KDecoration::isAlphaEnabled() const
KDecorationUnstable::KDecorationUnstable(KDecorationBridge* bridge, KDecorationFactory* factory)
: KDecoration(bridge, factory)
{
Q_ASSERT(dynamic_cast< KDecorationBridgeUnstable* >(bridge));
}
KDecorationUnstable::~KDecorationUnstable()