Skip to content

Commit 11a61c9

Browse files
committed
Merge in 'release/3.1' changes
2 parents c727463 + f9d25b0 commit 11a61c9

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,8 @@ public static StreamResourceInfo GetRemoteStream(Uri uriRemote)
700700
SiteOfOriginContainer sooContainer = (SiteOfOriginContainer)GetResourcePackage(packageUri);
701701

702702
// the SiteOfOriginContainer is shared across threads; synchronize access to it
703-
lock (_packageLock)
703+
// using the same lock object as other uses (PackWebResponse+CachedResponse.GetResponseStream)
704+
lock (sooContainer)
704705
{
705706
sooPart = sooContainer.GetPart(partUri) as SiteOfOriginPart;
706707
}
@@ -2017,8 +2018,9 @@ private static PackagePart GetResourceOrContentPart(Uri uri)
20172018
ResourceContainer resContainer = (ResourceContainer)GetResourcePackage(packageUri);
20182019

20192020
// the ResourceContainer is shared across threads; synchronize access to it
2021+
// using the same lock object as other uses (PackWebResponse+CachedResponse.GetResponseStream)
20202022
PackagePart part = null;
2021-
lock (_packageLock)
2023+
lock (resContainer)
20222024
{
20232025
part = resContainer.GetPart(partUri);
20242026
}
@@ -2417,7 +2419,6 @@ private object RunDispatcher(object ignore)
24172419
static private bool _appCreatedInThisAppDomain;
24182420
static private Application _appInstance;
24192421
static private Assembly _resourceAssembly;
2420-
static private object _packageLock = new Object();
24212422

24222423
// Keep LoadBamlSyncInfo stack so that the Outer LoadBaml and Inner LoadBaml( ) for the same
24232424
// Uri share the related information.

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DataGridColumnHeadersPresenterAutomationPeer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ protected override List<AutomationPeer> GetChildrenCore()
131131

132132
// protection from indistinguishable items - for example, 2 strings with same value
133133
// this scenario does not work in ItemsControl however is not checked for.
134-
if (ItemPeers[dataItem] == null)
134+
if (peer != null && ItemPeers[dataItem] == null)
135135
{
136136
children.Add(peer);
137137
ItemPeers[dataItem] = peer;

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/GroupItemAutomationPeer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ protected override List<AutomationPeer> GetChildrenCore()
274274
// but only if we haven't added a peer for this item during this GetChildrenCore call.
275275
bool itemMissingPeerInGlobalStorage = itemsControlAP.ItemPeers[item] == null;
276276

277-
if (itemMissingPeerInGlobalStorage
278-
|| (peer?.GetParent() == this && addedChildren[item] == null))
277+
if (peer != null && (itemMissingPeerInGlobalStorage
278+
|| (peer.GetParent() == this && addedChildren[item] == null)))
279279
{
280280
children.Add(peer);
281281
addedChildren[item] = peer;

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/ItemsControlAutomationPeer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ protected override List<AutomationPeer> GetChildrenCore()
199199

200200
// protection from indistinguishable items - for example, 2 strings with same value
201201
// this scenario does not work in ItemsControl however is not checked for.
202-
if (_dataChildren[dataItem] == null)
202+
if (peer != null && _dataChildren[dataItem] == null)
203203
{
204204
children.Add(peer);
205205
_dataChildren[dataItem] = peer;

0 commit comments

Comments
 (0)