-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Clean up mavlink inspector code to prevent crashing #13413
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
DonLakeFlyer
commented
Sep 21, 2025
- Remove dangling references to chart controllers
- Also modified to improve readability
- Possible replacement for Fix mavlink inspector crash #13309
* Remove dangling references to chart controllers * Also modified to improve readability
@vryabokon1705 Can you take a look at this? Both from a review standpoint as well as a testing and trying to repro the crash standpoint? The previous existing code for chart controllers was just a huge mess. There was no reason I could find the need to manage these dynamically. They should just work like other c++ controllers and be directly associated/created with the control. I believe this removes the possibility of crashing on in correct chart controller referencing. But I was not able to reproduce the crash you were seeing although I could understand how it could happen. That said this charting code is still a big mess and this only fixes one aspect of it. The fact that it tries to support multi-vehicle and doesn't correctly deal with vehicles going away will cause other crashes in those cases. This code needs further modification to remove support for multi-vehicle since it's hopeless to try to fix that given all the reach-around to other objects it has embedded in it. I'm going to deal with that in another pull. |
@vryabokon1705 When you saw it crashing, was it referencing a chart controller or was it crashing on a reference to a message field? |
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.
Pull Request Overview
This PR cleans up the MAVLink inspector code to prevent crashing by removing dangling references to chart controllers and improves code readability. The changes eliminate the central chart management system in favor of a more direct property-based approach.
- Removes the
createChart()
anddeleteChart()
methods fromMAVLinkInspectorController
that could cause dangling references - Refactors
MAVLinkChart
to use required properties instead of nullable chart controller references - Improves variable naming consistency throughout the codebase for better readability
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/QmlControls/MAVLinkChart.qml | Refactored to use required properties and removed chart controller creation/deletion logic |
src/AnalyzeView/MAVLinkMessageField.h | Renamed parameter from chart to chartController for consistency |
src/AnalyzeView/MAVLinkMessageField.cc | Updated variable names from _chart to _chartController for consistency |
src/AnalyzeView/MAVLinkInspectorPage.qml | Added required properties to chart instances and improved variable naming |
src/AnalyzeView/MAVLinkInspectorController.h | Removed chart management properties and methods |
src/AnalyzeView/MAVLinkInspectorController.cc | Removed chart creation/deletion methods and cleaned up logging category |
src/AnalyzeView/MAVLinkChartController.h | Changed from factory-created to QML-instantiated with required properties |
src/AnalyzeView/MAVLinkChartController.cc | Updated constructor and added setter for inspector controller |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
class MAVLinkChartController : public QObject | ||
{ | ||
Q_OBJECT | ||
QML_ELEMENT |
Copilot
AI
Sep 21, 2025
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.
Removing QML_UNCREATABLE(\"\")
makes this type creatable from QML, but the constructor now requires parameters that can't be provided from QML creation. Consider keeping QML_UNCREATABLE
or adding a default constructor that handles uninitialized state gracefully.
QML_ELEMENT | |
QML_UNCREATABLE("Cannot be created from QML. Use factory or set required properties.") |
Copilot uses AI. Check for mistakes.
Hi. Looks like it referencing a chart controller |
Ok, let I try it |
Hi. I am not able to reproduce the crash issue with this branch. It is Ok from my point of view. I uploaded video to show how you can reproduce it on the master branch. Screencast.from.2025-09-22.11-57-42.mp4 |
@vryabokon1705 Thanks so much for the help on this |