92a4cdd9e7
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 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
kcommondecoration.cpp | ||
kcommondecoration.h | ||
kcommondecoration_p.cpp | ||
kcommondecoration_p.h | ||
kdecoration.cpp | ||
kdecoration.h | ||
kdecoration_p.cpp | ||
kdecoration_p.h | ||
kdecoration_plugins_p.cpp | ||
kdecoration_plugins_p.h | ||
kdecorationbridge.h | ||
kdecorationfactory.cpp | ||
kdecorationfactory.h | ||
Mainpage.dox | ||
Messages.sh |