From e2c1d2d0ef50c0da24b60fc94529891055cf8043 Mon Sep 17 00:00:00 2001 From: Sophia Hadash Date: Sun, 26 Sep 2021 22:59:14 +0200 Subject: [PATCH] fix segfault in badge destructor fix margins --- es-core/src/components/BadgesComponent.cpp | 3 +-- es-core/src/components/FlexboxComponent.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/es-core/src/components/BadgesComponent.cpp b/es-core/src/components/BadgesComponent.cpp index 8adff44a1..e2fd9bfe4 100644 --- a/es-core/src/components/BadgesComponent.cpp +++ b/es-core/src/components/BadgesComponent.cpp @@ -51,8 +51,7 @@ BadgesComponent::BadgesComponent(Window *window) } BadgesComponent::~BadgesComponent() { - mBadgeIcons.clear(); - mImageComponents.clear(); + mChildren.clear(); } diff --git a/es-core/src/components/FlexboxComponent.cpp b/es-core/src/components/FlexboxComponent.cpp index b29159188..6665b2883 100644 --- a/es-core/src/components/FlexboxComponent.cpp +++ b/es-core/src/components/FlexboxComponent.cpp @@ -121,12 +121,12 @@ void FlexboxComponent::computeLayout() float y = anchorY - anchorOriginY * size.y; // Apply item margin. - if ((mDirection == "row" && i % std::max(1, (int) mItemsPerLine) != 0) || + /*if ((mDirection == "row" && i % std::max(1, (int) mItemsPerLine) != 0) || (mDirection == "column" && i >= (int) mItemsPerLine)) x += mItemMargin.x * (directionLine.x >= 0.0f ? 1.0f : -1.0f); if ((mDirection == "column" && i % std::max(1, (int) mItemsPerLine) != 0) || (mDirection == "row" && i >= (int) mItemsPerLine)) - y += mItemMargin.y * (directionLine.y >= 0.0f ? 1.0f : -1.0f); + y += mItemMargin.y * (directionLine.y >= 0.0f ? 1.0f : -1.0f);*/ // Apply alignment if (mAlign == ITEM_ALIGN_END) {