Fix[denumerator]: close GFileEnumerator when enumeration finishes#281
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:develop/eaglefrom Apr 29, 2026
Merged
Conversation
c2115c1 to
c01c699
Compare
liyigang1
reviewed
Apr 28, 2026
c01c699 to
f31b10f
Compare
liyigang1
approved these changes
Apr 28, 2026
f31b10f to
25d69d1
Compare
deepin pr auto review这段代码修改主要涉及文件枚举器( 1. 语法逻辑审查结果:通过
2. 代码质量审查结果:良好,但有改进空间
3. 代码性能审查结果:无显著影响
4. 代码安全审查结果:良好,但需注意线程安全
改进后的代码建议if (gerror) {
d->setErrorFromGError(gerror);
g_error_free(gerror); // 释放错误对象
gerror = nullptr;
d->nextUrl = QUrl();
d->dfileInfoNext.reset();
return true;
}
// 枚举完成,关闭并释放当前枚举器,释放 fd
if (!d->stackEnumerator.isEmpty()) {
GFileEnumerator *enumerator = d->stackEnumerator.pop();
if (enumerator) {
g_file_enumerator_close(enumerator, nullptr, nullptr);
g_object_unref(enumerator);
}
}总结
|
Close and release GFileEnumerator after all entries are consumed to prevent file descriptor leak on GVFS mount points (e.g. Vault). 枚举完成后关闭并释放GFileEnumerator,防止GVFS挂载点(如保险箱)的文件描述符泄漏。 Log: 修复枚举器耗尽后fd未释放的问题 Bug: https://pms.uniontech.com/bug-view-358881.html Influence: 修复遍历Vault等GVFS目录后文件描述符一直被占用的问题,枚举完成后正确释放资源。
25d69d1 to
6b5529c
Compare
max-lvs
approved these changes
Apr 29, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017, liyigang1, max-lvs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: unstable) |
66ea1a8
into
linuxdeepin:develop/eagle
19 of 21 checks passed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Close and release GFileEnumerator after all entries are consumed to prevent file descriptor leak on GVFS mount points (e.g. Vault).
枚举完成后关闭并释放GFileEnumerator,防止GVFS挂载点(如保险箱)的文件描述符泄漏。
Log: 修复枚举器耗尽后fd未释放的问题
Influence: 修复遍历Vault等GVFS目录后文件描述符一直被占用的问题,枚举完成后正确释放资源。