From 09e2e16353a3b7d17b4a2136ea2d91ce6a3d614f Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 7 Oct 2019 14:54:35 +0300 Subject: [PATCH] Various crash fixes --- submodules/AsyncDisplayKit/Source/ASDisplayNode.mm | 2 +- .../GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift | 2 +- .../LegacyComponents/TGNavigationController.m | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm b/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm index f4e3238448..8817bb8d8e 100644 --- a/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm +++ b/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm @@ -472,7 +472,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); [self baseWillDealloc]; // Synchronous nodes may not be able to call the hierarchy notifications, so only enforce for regular nodes. - ASDisplayNodeAssert(checkFlag(Synchronous) || !ASInterfaceStateIncludesVisible(_interfaceState), @"Node should always be marked invisible before deallocating. Node: %@", self); + //ASDisplayNodeAssert(checkFlag(Synchronous) || !ASInterfaceStateIncludesVisible(_interfaceState), @"Node should always be marked invisible before deallocating. Node: %@", self); self.asyncLayer.asyncDelegate = nil; _view.asyncdisplaykit_node = nil; diff --git a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift index f63c0a9461..a560bbf3ae 100644 --- a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift @@ -131,7 +131,7 @@ private final class UniversalVideoGalleryItemPictureInPictureNode: ASDisplayNode func updateLayout(_ size: CGSize, transition: ContainedViewLayoutTransition) { let iconSize = self.iconNode.image?.size ?? CGSize() - let textSize = self.textNode.measure(CGSize(width: size.width - 20.0, height: CGFloat.greatestFiniteMagnitude)) + let textSize = self.textNode.measure(CGSize(width: max(0.0, size.width - 20.0), height: CGFloat.greatestFiniteMagnitude)) let spacing: CGFloat = 10.0 let contentHeight = iconSize.height + spacing + textSize.height let contentVerticalOrigin = floor((size.height - contentHeight) / 2.0) diff --git a/submodules/LegacyComponents/LegacyComponents/TGNavigationController.m b/submodules/LegacyComponents/LegacyComponents/TGNavigationController.m index 481769c272..440d7325f3 100644 --- a/submodules/LegacyComponents/LegacyComponents/TGNavigationController.m +++ b/submodules/LegacyComponents/LegacyComponents/TGNavigationController.m @@ -1011,6 +1011,10 @@ TGNavigationController *findNavigationController() @implementation TGNavigationPanGestureRecognizer +- (UIRectEdge)edges { + return UIRectEdgeLeft; +} + - (void)_setEdgeRegionSize:(CGFloat)edgeRegionSize { __edgeRegionSize = edgeRegionSize;