Skip to content

Commit d0c3a88

Browse files
committed
fix a couple of leaks in qtgui
1 parent 5ddbc42 commit d0c3a88

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/backends/qtgui/AgentInjector.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ void AgentInjector::onSelect(QListWidgetItem *current, QListWidgetItem *prev) {
6565
}
6666

6767
void AgentInjector::resetAgents() {
68+
if (engine.version == 2) {
69+
for (int i = 0; i < ui.agentList->count(); i++) {
70+
QListWidgetItem *item = ui.agentList->item(i);
71+
cobAgentBlock *b = (cobAgentBlock *)item->data(Qt::UserRole).value<void *>();
72+
delete b;
73+
}
74+
}
6875
ui.agentList->clear();
6976
ui.injectButton->setEnabled(false);
7077
ui.removeButton->setEnabled(false);

src/backends/qtgui/Hatchery.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Hatchery::Hatchery(QtOpenc2e *parent) : QDialog(parent) {
182182
resize(hatcherybg.width() + 6, hatcherybg.height() + 6);
183183

184184
/* create the widgets/layout */
185-
graphicsScene = new QGraphicsScene();
185+
graphicsScene = new QGraphicsScene(this);
186186
graphicsView = new QGraphicsView(graphicsScene, this);
187187
QHBoxLayout *layout = new QHBoxLayout(this);
188188
layout->addWidget(graphicsView);

0 commit comments

Comments
 (0)