Diffusion KWin 34f28508910c

Remove assertion in KDecorationUnstable's constructor.

Authored by rakuco on Oct 16 2013, 10:09 PM.

Description

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

Details

Committed
rakucoOct 20 2013, 2:37 PM
Parents
R108:2b5963a3de37: Fix zoom effect cursor position on initial zoom in.
Branches
Unknown
Tags
Unknown