Skip to content

Commit

Permalink
Merge pull request dotnet#481 from stephentoub/fix_process_guards
Browse files Browse the repository at this point in the history
Guard _processInfo access with EnsureState checks
  • Loading branch information
stephentoub committed Jan 20, 2015
2 parents 7aaecaa + fab4dfa commit 3786e9c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/System.Diagnostics.Process/src/System/Diagnostics/Process.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ public long NonpagedSystemMemorySize64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._poolNonpagedBytes;
}
}
Expand All @@ -323,6 +324,7 @@ public long PagedMemorySize64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._pageFileBytes;
}
}
Expand All @@ -332,6 +334,7 @@ public long PagedSystemMemorySize64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._poolPagedBytes;
}
}
Expand All @@ -341,6 +344,7 @@ public long PeakPagedMemorySize64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._pageFileBytesPeak;
}
}
Expand All @@ -350,6 +354,7 @@ public long PeakWorkingSet64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._workingSetPeak;
}
}
Expand All @@ -359,6 +364,7 @@ public long PeakVirtualMemorySize64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._virtualBytesPeak;
}
}
Expand Down Expand Up @@ -424,6 +430,7 @@ public long PrivateMemorySize64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._privateBytes;
}
}
Expand Down Expand Up @@ -472,6 +479,7 @@ public int SessionId
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._sessionId;
}
}
Expand Down Expand Up @@ -533,6 +541,7 @@ public long VirtualMemorySize64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._virtualBytes;
}
}
Expand Down Expand Up @@ -643,6 +652,7 @@ public long WorkingSet64
{
get
{
EnsureState(State.HaveProcessInfo);
return _processInfo._workingSet;
}
}
Expand Down

0 comments on commit 3786e9c

Please sign in to comment.