mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
Fix memory leaks found by ASAN. (#1590)
This commit is contained in:
parent
14665cbe8a
commit
6c76c85c97
@ -127,8 +127,8 @@ BreakpointWidget::BreakpointWidget(MainWindow *main, QAction *action) :
|
||||
});
|
||||
|
||||
setScrollMode();
|
||||
actionDelBreakpoint = new QAction(tr("Delete breakpoint"));
|
||||
actionToggleBreakpoint = new QAction(tr("Toggle breakpoint"));
|
||||
actionDelBreakpoint = new QAction(tr("Delete breakpoint"), this);
|
||||
actionToggleBreakpoint = new QAction(tr("Toggle breakpoint"), this);
|
||||
connect(actionDelBreakpoint, &QAction::triggered, this, &BreakpointWidget::delBreakpoint);
|
||||
connect(actionToggleBreakpoint, &QAction::triggered, this, &BreakpointWidget::toggleBreakpoint);
|
||||
connect(Core(), &CutterCore::refreshAll, this, &BreakpointWidget::refreshBreakpoint);
|
||||
|
@ -68,7 +68,7 @@ DebugActions::DebugActions(QToolBar *toolBar, MainWindow *main) :
|
||||
QToolButton *startButton = new QToolButton;
|
||||
startButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
connect(startButton, &QToolButton::triggered, startButton, &QToolButton::setDefaultAction);
|
||||
QMenu *startMenu = new QMenu;
|
||||
QMenu *startMenu = new QMenu(startButton);
|
||||
|
||||
// only emulation is currently allowed
|
||||
// startMenu->addAction(actionStart);
|
||||
@ -82,7 +82,7 @@ DebugActions::DebugActions(QToolBar *toolBar, MainWindow *main) :
|
||||
continueUntilButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
connect(continueUntilButton, &QToolButton::triggered, continueUntilButton,
|
||||
&QToolButton::setDefaultAction);
|
||||
QMenu *continueUntilMenu = new QMenu;
|
||||
QMenu *continueUntilMenu = new QMenu(continueUntilButton);
|
||||
continueUntilMenu->addAction(actionContinueUntilMain);
|
||||
continueUntilMenu->addAction(actionContinueUntilCall);
|
||||
continueUntilMenu->addAction(actionContinueUntilSyscall);
|
||||
|
@ -122,7 +122,7 @@ HexWidget::HexWidget(QWidget *parent) :
|
||||
|
||||
startAddress = 0ULL;
|
||||
cursor.address = 0ULL;
|
||||
data = new MemoryData();
|
||||
data.reset(new MemoryData());
|
||||
|
||||
fetchData();
|
||||
updateCursorMeta();
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <QScrollArea>
|
||||
#include <QTimer>
|
||||
#include <QMenu>
|
||||
#include <memory>
|
||||
|
||||
struct BasicCursor
|
||||
{
|
||||
@ -457,7 +458,7 @@ private:
|
||||
QAction *actionCopyAddress;
|
||||
QAction *actionSelectRange;
|
||||
|
||||
AbstractData *data;
|
||||
std::unique_ptr<AbstractData> data;
|
||||
};
|
||||
|
||||
#endif // HEXWIDGET_H
|
||||
|
@ -118,8 +118,8 @@ RegisterRefsWidget::RegisterRefsWidget(MainWindow *main, QAction *action) :
|
||||
ui->registerRefTreeView->setModel(registerRefProxyModel);
|
||||
ui->registerRefTreeView->sortByColumn(RegisterRefModel::RegColumn, Qt::AscendingOrder);
|
||||
|
||||
actionCopyValue = new QAction(tr("Copy register value"));
|
||||
actionCopyRef = new QAction(tr("Copy register reference"));
|
||||
actionCopyValue = new QAction(tr("Copy register value"), this);
|
||||
actionCopyRef = new QAction(tr("Copy register reference"), this);
|
||||
|
||||
refreshDeferrer = createRefreshDeferrer([this](){
|
||||
refreshRegisterRef();
|
||||
|
@ -321,8 +321,8 @@ void SectionsWidget::updateToggle()
|
||||
|
||||
AbstractAddrDock::AbstractAddrDock(SectionsModel *model, QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
addrDockScene(new AddrDockScene),
|
||||
graphicsView(new QGraphicsView)
|
||||
addrDockScene(new AddrDockScene(this)),
|
||||
graphicsView(new QGraphicsView(this))
|
||||
{
|
||||
graphicsView->setScene(addrDockScene);
|
||||
setWidget(graphicsView);
|
||||
|
@ -25,8 +25,8 @@ StackWidget::StackWidget(MainWindow *main, QAction *action) :
|
||||
viewStack->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
ui->verticalLayout->addWidget(viewStack);
|
||||
|
||||
seekAction = new QAction(tr("Seek to this offset"));
|
||||
editAction = new QAction(tr("Edit stack value..."));
|
||||
seekAction = new QAction(tr("Seek to this offset"), this);
|
||||
editAction = new QAction(tr("Edit stack value..."), this);
|
||||
viewStack->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
refreshDeferrer = createRefreshDeferrer([this]() {
|
||||
|
@ -138,7 +138,7 @@ VTablesWidget::VTablesWidget(MainWindow *main, QAction *action) :
|
||||
tree->addStatusBar(ui->verticalLayout);
|
||||
|
||||
model = new VTableModel(&vtables, this);
|
||||
proxy = new VTableSortFilterProxyModel(model);
|
||||
proxy = new VTableSortFilterProxyModel(model, this);
|
||||
|
||||
ui->vTableTreeView->setModel(proxy);
|
||||
ui->vTableTreeView->sortByColumn(VTableModel::ADDRESS, Qt::AscendingOrder);
|
||||
|
Loading…
Reference in New Issue
Block a user