Set createValueFunc to null once the Func delegate is not needed. Without breaking the reference, the lambda function will keep capturing of any outer variables, in #4345, DocumentServiceRequest was captured, which prevent GC from recycling the request object, cause memory leak.
Below code, the request object will be captured by singleValueInitFunc delegate.
Pull Request Template
Description
Set createValueFunc to null once the Func delegate is not needed. Without breaking the reference, the lambda function will keep capturing of any outer variables, in #4345, DocumentServiceRequest was captured, which prevent GC from recycling the request object, cause memory leak.
Below code, the request object will be captured by singleValueInitFunc delegate.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #4345