-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Draft] Release font resources to fix memory leak #9250
Draft
hiteshwpfmsft
wants to merge
3
commits into
main
Choose a base branch
from
user/hik/MemoryLeakReleaseFontResource
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lindexi
reviewed
Jun 24, 2024
@@ -23,16 +23,16 @@ namespace System.Windows.Xps.Serialization.RCW | |||
[ComImport] | |||
internal interface IXpsOMPartUriCollection | |||
{ | |||
void Append([In] IOpcPartUri partUri); | |||
uint GetCount(); |
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.
After reading xpsobjectmodel.h, I think your changes are correct.
Addition, the define of IXpsOMPartUriCollection in xpsobjectmodel.h:
MIDL_INTERFACE("57C650D4-067C-4893-8C33-F62A0633730F")
IXpsOMPartUriCollection : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCount(
/* [retval][out] */ __RPC__out UINT32 *count) = 0;
virtual HRESULT STDMETHODCALLTYPE GetAt(
/* [in] */ UINT32 index,
/* [retval][out] */ __RPC__deref_out_opt IOpcPartUri **partUri) = 0;
virtual HRESULT STDMETHODCALLTYPE InsertAt(
/* [in] */ UINT32 index,
/* [in] */ __RPC__in_opt IOpcPartUri *partUri) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveAt(
/* [in] */ UINT32 index) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAt(
/* [in] */ UINT32 index,
/* [in] */ __RPC__in_opt IOpcPartUri *partUri) = 0;
virtual HRESULT STDMETHODCALLTYPE Append(
/* [in] */ __RPC__in_opt IOpcPartUri *partUri) = 0;
};
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
draft
* NO MERGE *
metadata: The PR is not ready for merge yet (see discussion for detailed reasons)
PR
metadata: Label to tag PRs, to facilitate with triage
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6296
Description
Printing a large size of document ends up consuming a lot of memory. The change in the PR targets to address this issue.
This change releases the font resources after every four pages. We see huge memory consumption difference as the number of pages grow.
Also, with the change we make sure that all resources gests released once printing is completed.
Regression
Don't know.
Testing
Under testing.
Risk
Low.