mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
Fix crash when SVG is unloaded by XAML (#2195)
XAML may unload the root SVG panel, which will trigger a recursive unload. For GroupView, this unload will clear the child collection. However, active operations on the SVG from the React Native UIManager may still be in flight, in which case we may attempt to remove a child that has already been cleared by the root unload.
This commit is contained in:
@@ -358,6 +358,7 @@ void RenderableView::Unload() {
|
||||
m_propList.clear();
|
||||
m_propSetMap.clear();
|
||||
m_strokeDashArray.Clear();
|
||||
m_isUnloaded = true;
|
||||
}
|
||||
|
||||
RNSVG::IRenderable RenderableView::HitTest(Point const &point) {
|
||||
@@ -370,7 +371,7 @@ RNSVG::IRenderable RenderableView::HitTest(Point const &point) {
|
||||
if (auto const &svgRoot{SvgRoot()}) {
|
||||
float canvasDiagonal{Utils::GetCanvasDiagonal(svgRoot.ActualSize())};
|
||||
float strokeWidth{Utils::GetAbsoluteLength(StrokeWidth(), canvasDiagonal)};
|
||||
|
||||
|
||||
check_hresult(geometry->StrokeContainsPoint(pointD2D, strokeWidth, nullptr, nullptr, &strokeContainsPoint));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user