-
-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The issue was about leaks reported by leak sanitizer: Indirect leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f5c95377d80 in operator new(unsigned long) #1 0x7f5c7e695267 in HardwareBreakpointsPlugin::HardwareBreakpoints::stackContextMenu() HardwareBreakpoints.cpp:253 #2 0x694aac in Debugger::Debugger(QWidget*) Debugger.cpp:485 #3 0x4e683a in start_debugger main.cpp:96 #4 0x4e683a in main main.cpp:255 Indirect leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f5c95377d80 in operator new(unsigned long) #1 0x7f5c7e69ba38 in HardwareBreakpointsPlugin::HardwareBreakpoints::cpuContextMenu() HardwareBreakpoints.cpp:324 #2 0x694aac in Debugger::Debugger(QWidget*) Debugger.cpp:485 #3 0x4e683a in start_debugger main.cpp:96 #4 0x4e683a in main main.cpp:255 Indirect leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7f5c95377d80 in operator new(unsigned long) #1 0x7f5c7e6985d7 in HardwareBreakpointsPlugin::HardwareBreakpoints::dataContextMenu() HardwareBreakpoints.cpp:288 #2 0x694aac in Debugger::Debugger(QWidget*) Debugger.cpp:485 #3 0x4e683a in start_debugger main.cpp:96 #4 0x4e683a in main main.cpp:255 The most idiomatic way to fix the issue was to assign a parent to the submenus created in these functions. Unfortunately there is no suitable parent available in these functions. This commit fixes the issue in the most straight-forward way possible: it just adds QMenu* parent parameter to the functions * IPlugin::cpuContextMenu * IPlugin::registerContextMenu * IPlugin::stackContextMenu * IPlugin::dataContextMenu This allows plugins to set proper parent to all submenus they choose to create in order for them to be properly destroyed when root menu is destroyed. This commit also sets parents to the QActions that are created in these functions so they are timedly destroyed. As a possible follow-up these QActions can be created once in plugin constructor and not everytime the menu is created.
- Loading branch information
Showing
16 changed files
with
41 additions
and
41 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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