Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.

process needs to be disposed of #252

Merged
merged 1 commit into from
Mar 30, 2020
Merged

process needs to be disposed of #252

merged 1 commit into from
Mar 30, 2020

Conversation

SimonCropp
Copy link
Contributor

No description provided.

Unverified

This user has not yet uploaded their public signing key.
@@ -347,6 +347,12 @@ private void WriteReplicaToStore(string pid)
return null;
}

private static string GetEntryPointFilePath()
{
using var process = Process.GetCurrentProcess();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this return a new instance every time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

public static Process GetCurrentProcess()
{
	return new Process(".", isRemoteMachine: false, NativeMethods.GetCurrentProcessId(), null);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think "returns new instance" is meant to be implied by the fact that it is a method and not a property

@SimonCropp SimonCropp requested a review from davidfowl March 30, 2020 00:29
@davidfowl davidfowl merged commit eface3f into dotnet:master Mar 30, 2020
@SimonCropp SimonCropp deleted the missingDispose branch March 30, 2020 00:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants