-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NEO callstates #3599
base: HF_Echidna
Are you sure you want to change the base?
Fix NEO callstates #3599
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vote
method requires this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better this way. Probably solving any other similar problems (like CpuFee
updates). I'd try avoiding unnecessary changes, but that's nitpicking mostly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix these memory leaks
Co-authored-by: Christopher Schuchardt <[email protected]>
Co-authored-by: Christopher Schuchardt <[email protected]>
src/Neo/ProtocolSettings.cs
Outdated
@@ -131,7 +131,7 @@ public record ProtocolSettings | |||
/// <returns>The loaded <see cref="ProtocolSettings"/>.</returns> | |||
public static ProtocolSettings Load(Stream stream) | |||
{ | |||
var config = new ConfigurationBuilder().AddJsonStream(stream).Build(); | |||
using var config = new ConfigurationBuilder().AddJsonStream(stream).Build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigurationBuilder
on build uses ConfigurationRoot
may have to cast to it. either way needs to be fixed for memory leak.
or could do
((IDisposable)config).Dispose();
at of the method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not a memory leak...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfiguationRoot
is the class that is created for inherits from IConfigurationRoot
How isn't it a memory leak, The memory for the providers are still allocated? Streams and all.
https://github.com/dotnet/runtime/blob/9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3/src/libraries/Microsoft.Extensions.Configuration/src/ConfigurationRoot.cs#L99C9-L112C10
Just do (config as IDisposable)?.Dispose()
what's the big deal?
Ready to review again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
ContractMethodAttribute attribute = member.GetCustomAttribute<ContractMethodAttribute>(); | ||
if (attribute is null) continue; | ||
listMethods.Add(new ContractMethodMetadata(member, attribute)); | ||
foreach (var attribute in member.GetCustomAttributes<ContractMethodAttribute>()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously there was a check for if (attribute is null)
, is it possible that attribute is nil with the current implementation? I think it's OK, but we'd better make sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, now can't be null
Description
Fixes #3596
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: