-
Notifications
You must be signed in to change notification settings - Fork 57
sync: from linuxdeepin/dde-session-shell #439
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
Conversation
Reviewer's GuideThis PR synchronizes upstream changes by refactoring plugin loader cleanup logic in ModulesLoader, introducing centralized cleanupPluginLoader with proper mutex locking and resource deletion, updating SPDX license headers across several source files, and importing new Spanish translation files. Class diagram for updated ModulesLoader plugin cleanup logicclassDiagram
class ModulesLoader {
+~ModulesLoader()
+void findModule(const QString& path)
+bool isPluginEnabled(const QFileInfo& module)
+void unloadPlugin(const QString& path)
+void cleanupPluginLoader(QPluginLoader* loader)
-QList<QPluginLoader*> m_pluginLoaders
-QMutex m_mutex
}
class QPluginLoader {
+bool unload()
+void deleteLater()
+QString errorString()
+QObject* instance()
}
ModulesLoader --> QPluginLoader : manages
ModulesLoader : +cleanupPluginLoader(loader)
ModulesLoader : now uses cleanupPluginLoader for plugin cleanup
ModulesLoader : uses QMutexLocker for thread safety
Class diagram for QDBusInterface resource management in isPluginEnabledclassDiagram
class ModulesLoader {
+bool isPluginEnabled(const QFileInfo& module)
}
class QDBusInterface {
+bool isValid()
+void deleteLater()
+QVariant property(const char*)
}
ModulesLoader --> QDBusInterface : creates and deletes
ModulesLoader : now calls deleteLater() on invalid QDBusInterface
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @deepin-ci-robot - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `src/global_util/plugin_manager/modules_loader.cpp:358` </location>
<code_context>
}
}
+void ModulesLoader::cleanupPluginLoader(QPluginLoader* loader)
+{
+ if (loader) {
+ loader->unload();
+ loader->deleteLater();
+ }
+}
+
</code_context>
<issue_to_address>
cleanupPluginLoader does not handle the case where unload fails.
Check the result of loader->unload() and handle or log errors if it fails before calling deleteLater.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
void ModulesLoader::cleanupPluginLoader(QPluginLoader* loader)
{
if (loader) {
loader->unload();
loader->deleteLater();
}
}
=======
void ModulesLoader::cleanupPluginLoader(QPluginLoader* loader)
{
if (loader) {
if (!loader->unload()) {
qCWarning(DDE_SHELL) << "Failed to unload plugin:" << loader->fileName() << "-" << loader->errorString();
}
loader->deleteLater();
}
}
>>>>>>> REPLACE
</suggested_fix>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| void ModulesLoader::cleanupPluginLoader(QPluginLoader* loader) | ||
| { | ||
| if (loader) { | ||
| loader->unload(); | ||
| loader->deleteLater(); | ||
| } | ||
| } |
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.
suggestion: cleanupPluginLoader does not handle the case where unload fails.
Check the result of loader->unload() and handle or log errors if it fails before calling deleteLater.
| void ModulesLoader::cleanupPluginLoader(QPluginLoader* loader) | |
| { | |
| if (loader) { | |
| loader->unload(); | |
| loader->deleteLater(); | |
| } | |
| } | |
| void ModulesLoader::cleanupPluginLoader(QPluginLoader* loader) | |
| { | |
| if (loader) { | |
| if (!loader->unload()) { | |
| qCWarning(DDE_SHELL) << "Failed to unload plugin:" << loader->fileName() << "-" << loader->errorString(); | |
| } | |
| loader->deleteLater(); | |
| } | |
| } |
0c706ae to
abb8c77
Compare
deepin pr auto review代码审查意见:
以上是本次代码提交的审查意见,希望能够帮助到您。 |
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#21
abb8c77 to
4f23d39
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-ci-robot, yixinshark 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 |
Synchronize source files from linuxdeepin/dde-session-shell.
Source-pull-request: linuxdeepin/dde-session-shell#21
Summary by Sourcery
Sync upstream dde-session-shell changes: enhance plugin loader cleanup and leak prevention, update SPDX license headers, and add Spanish translations.
Enhancements:
Documentation: