Skip to content

Commit

Permalink
[UWP] Fix cirucular reference in element tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Muraira committed Sep 27, 2019
1 parent a52ec34 commit 8881066
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion source/uwp/Renderer/lib/ElementTagContent.cpp
Expand Up @@ -4,6 +4,7 @@
#include "pch.h"
#include "ElementTagContent.h"

using namespace Microsoft::WRL;
using namespace ABI::AdaptiveNamespace;
using namespace ABI::Windows::UI::Xaml;
using namespace ABI::Windows::UI::Xaml::Controls;
Expand All @@ -16,8 +17,10 @@ namespace AdaptiveNamespace
_In_ IColumnDefinition* columnDefinition,
_In_ boolean expectedVisibility)
{
ComPtr<IPanel> localParentPanel(parentPanel);
RETURN_IF_FAILED(localParentPanel.AsWeak(&m_parentPanel));

m_columnDefinition = columnDefinition;
m_parentPanel = parentPanel;
m_separator = separator;
m_cardElement = cardElement;
m_expectedVisibility = expectedVisibility;
Expand Down
2 changes: 1 addition & 1 deletion source/uwp/Renderer/lib/ElementTagContent.h
Expand Up @@ -40,7 +40,7 @@ namespace AdaptiveNamespace
Microsoft::WRL::ComPtr<ABI::AdaptiveNamespace::IAdaptiveCardElement> m_cardElement;
Microsoft::WRL::ComPtr<ABI::Windows::UI::Xaml::Controls::IColumnDefinition> m_columnDefinition;
Microsoft::WRL::ComPtr<ABI::Windows::UI::Xaml::IUIElement> m_separator;
Microsoft::WRL::ComPtr<ABI::Windows::UI::Xaml::Controls::IPanel> m_parentPanel;
Microsoft::WRL::WeakRef m_parentPanel;
boolean m_expectedVisibility;
};
}
5 changes: 4 additions & 1 deletion source/uwp/Renderer/lib/RenderedAdaptiveCard.cpp
Expand Up @@ -240,7 +240,10 @@ namespace AdaptiveNamespace

for (auto parentPanel : parentPanels)
{
XamlHelpers::SetSeparatorVisibility(parentPanel);
if (parentPanel)
{
XamlHelpers::SetSeparatorVisibility(parentPanel);
}
}

return S_OK;
Expand Down

0 comments on commit 8881066

Please sign in to comment.