Skip to content

Commit

Permalink
Syncing content from committish f6b3531dce4818fb5bf5130a6cd96bca2d3de762
Browse files Browse the repository at this point in the history
  • Loading branch information
reunion-maestro-bot committed Nov 12, 2024
1 parent f31293f commit 14364e6
Show file tree
Hide file tree
Showing 10 changed files with 684 additions and 198 deletions.
2 changes: 1 addition & 1 deletion src/controls/dev/Collections/HashMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ template <typename K, typename V>
class HashMap :
public ReferenceTracker<
HashMap<K, V>,
reference_tracker_implements_t<winrt::IMap<K, V>>::type,
typename reference_tracker_implements_t<winrt::IMap<K, V>>::type,
winrt::IMapView<K, V>,
winrt::IIterable<winrt::IKeyValuePair<K, V>>>
{
Expand Down
2 changes: 1 addition & 1 deletion src/controls/dev/Collections/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ template <typename T, bool isObservable, bool isBindable, bool isDependencyObjec
class VectorBase :
public ReferenceTracker<
VectorBase<T, isObservable, isBindable, isDependencyObjectBase, isNoTrackerRef, Options>,
reference_tracker_implements_t<typename Options::VectorType>::type,
typename reference_tracker_implements_t<typename Options::VectorType>::type,
typename Options::IterableType,
std::conditional_t<isObservable, typename Options::ObservableVectorType, void>>,
public Options::IVectorOwner
Expand Down
2 changes: 1 addition & 1 deletion src/controls/dev/Collections/VectorIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ template <typename T, bool isBindable = false, bool isDependencyObjectBase = tru
class VectorIterator :
public ReferenceTracker<
VectorIterator<T, isBindable, isDependencyObjectBase, Traits>,
reference_tracker_implements_t<typename Traits::IteratorType>::type>
typename reference_tracker_implements_t<typename Traits::IteratorType>::type>
{
public:
VectorIterator(typename Traits::VectorType const& vector)
Expand Down
3 changes: 0 additions & 3 deletions src/dxaml/Xaml.NTLegacy.Cpp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,9 @@

<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);_HAS_MAGIC_STATICS=1;</PreprocessorDefinitions>
<!-- <AdditionalOptions>%(AdditionalOptions) -dvc7dname</AdditionalOptions> -->
<AdditionalOptions>%(AdditionalOptions) /Qspectre -d1vc7dname -Zc:sizedDealloc-</AdditionalOptions>
<AdditionalOptions Condition="'$(PlatformTarget)'=='x86'">%(AdditionalOptions) /d2noftol3</AdditionalOptions>
</ClCompile>
<ClCompile Condition="'$(Immersive)'=='true'">
<!-- <AdditionalOptions>%(AdditionalOptions) -dvc7dname</AdditionalOptions> -->
<AdditionalOptions Condition="'$(PlatformTarget)'=='x86'">%(AdditionalOptions) /d2noftol3 /d2CoroOptsWorkaround</AdditionalOptions>

</ClCompile>
Expand Down
2 changes: 0 additions & 2 deletions src/dxaml/msbuild/BuildSettings/LibraryCompile.props
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
<!-- MSVC options. -->
<ExtraOptions Condition="'$(ExperimentalClang)' != 'true'">%(ExtraOptions)
/d1import_no_registry
/d1vc7dname
/d2NoSmallFunctionOpt
/d2CoroOptsWorkaround
/d2AllowCompatibleILVersions
Expand Down Expand Up @@ -166,7 +165,6 @@
/Brepro
/d1import_no_registry
/d1ReturnUdtEHInline
-d1vc7dname
/d1ZWodr
/d2AllowCompatibleILVersions
/d2CoroOptsWorkaround
Expand Down
23 changes: 21 additions & 2 deletions src/dxaml/xcp/core/inc/UIDMContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class CUIElement;
#include <ComTemplates.h>
#include "DirectManipulationContainerHandler.h"
#include "DirectManipulationContainer.h"
#include <FrameworkUdk/Containment.h>

// Bug 54433864: WinAppSDK 1.7: Using WinUI ListView and/or ItemsRepeater causes a substantial increase in unmanaged memory usage
// Bug 54705344: WinAppSDK 1.6.2 Servicing: Using WinUI ListView and/or ItemsRepeater causes a substantial increase in unmanaged memory usage
#define WINAPPSDK_CHANGEID_54705344 54705344

class CUIDMContainer : public ctl::implements<IUnknown>
{
Expand Down Expand Up @@ -169,7 +174,6 @@ class CUIDMContainer : public ctl::implements<IUnknown>
// Constructor
CUIDMContainer(_In_ CCoreServices* pCoreServices, _In_ CUIElement* pUIElement)
: m_pCoreServices(pCoreServices)
, m_pUIElement(pUIElement)
, m_pDMContainerHandler(NULL)
{
#ifdef DMCNTNR_DBG
Expand All @@ -181,7 +185,16 @@ class CUIDMContainer : public ctl::implements<IUnknown>
pCoreServices->AddRef();

ASSERT(pUIElement);
pUIElement->AddRef();

if (WinAppSdk::Containment::IsChangeEnabled<WINAPPSDK_CHANGEID_54705344>())
{
m_pUIElementWeakRef = xref::get_weakref(pUIElement);
}
else
{
m_pUIElement = pUIElement;
pUIElement->AddRef();
}
}

protected:
Expand Down Expand Up @@ -213,7 +226,13 @@ class CUIDMContainer : public ctl::implements<IUnknown>

private:
CCoreServices* m_pCoreServices;

// Used when WinAppSDK 1.6.2 fix for 54705344 is not applied:
CUIElement* m_pUIElement; // CUIElement object associated to this implementation

// Used when WinAppSDK 1.6.2 fix for 54705344 is applied:
xref::weakref_ptr<CUIElement> m_pUIElementWeakRef; // CUIElement object associated to this implementation

IDirectManipulationContainerHandler* m_pDMContainerHandler;
};

5 changes: 5 additions & 0 deletions src/dxaml/xcp/core/inc/UIDMContainerHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ class CUIDMContainerHandler final : public CXcpObjectBase<IDirectManipulationCon

private:
CInputServices* m_inputServices;

// Used when WinAppSDK 1.6.2 fix for 54705344 is not applied:
CUIElement* m_pUIElement; // CUIElement object associated to this IDirectManipulationContainerHandler implementation

// Used when WinAppSDK 1.6.2 fix for 54705344 is applied:
xref::weakref_ptr<CUIElement> m_pUIElementWeakRef; // CUIElement object associated to this IDirectManipulationContainerHandler implementation
};

Loading

0 comments on commit 14364e6

Please sign in to comment.