diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-07-23 00:46:20 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-07-23 00:46:20 +0300 |
commit | 3f48ab1c0560d9a0c9401990aa4c9ddfca826d0b (patch) | |
tree | 3e5495e57adfbc2aa540e39c6e6a17aa2e0535e2 /indra/llui | |
parent | cd6f7a4e6f90270c1a2f66afe6317bffb2f73088 (diff) |
SL-13642 Get rid of that ugly ignore -Wdelete-incomplete
Get rid of that ugly '#pragma clang diagnostic ignored "-Wdelete-incomplete"' by making sure the delete always happens inside llview.cpp, where the type of LLView is known.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llrngwriter.cpp | 7 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 10 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 5 |
3 files changed, 7 insertions, 15 deletions
diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp index 80e9842a9b..4bd1561425 100644 --- a/indra/llui/llrngwriter.cpp +++ b/indra/llui/llrngwriter.cpp @@ -29,14 +29,7 @@ #include "llrngwriter.h" #include "lluicolor.h" -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-incomplete" #include "lluictrlfactory.h" -#pragma clang diagnostic pop -#else -#include "lluictrlfactory.h" -#endif #include "boost/bind.hpp" diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 0ed7fb09b3..135ed57a4f 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -37,6 +37,7 @@ #include "llheteromap.h" class LLView; +void deleteView(LLView*); // Inside LLView.cpp, avoid having to potentially delete an incomplete type here. // lookup widget constructor funcs by widget name template <typename DERIVED_TYPE> @@ -174,14 +175,7 @@ public: { LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL; -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdelete-incomplete" - delete view; -#pragma clang diagnostic pop -#else - delete view; -#endif + deleteView(view); view = NULL; } } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 593c8b12fc..bd213d594a 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -86,6 +86,11 @@ template class LLView* LLView::getChild<class LLView>( static LLDefaultChildRegistry::Register<LLView> r("view"); +void deleteView(LLView *aView) +{ + delete aView; +} + namespace LLInitParam { void TypeValues<LLView::EOrientation>::declareValues() |