From 738fd485d7c7d4da8c40c9c10566570e23d30a65 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sat, 13 Aug 2016 13:01:07 +0200 Subject: [PATCH] Fix crash when closing session Instead of manually deleting the output suspended label let the QObject cleanup handle it. Now it is first deleted manually by us, leading to a potential crash, and afterwards the QObject cleanup runs, but luckily it doesn' try to destroy it again. REVIEW: 128667 BUG: 366706 (cherry picked from commit b2b852cfd7b10fc2ffb668ac87f8ca9236a134e3) --- src/TerminalDisplay.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 4f28837d..555a9913 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -429,7 +429,7 @@ TerminalDisplay::TerminalDisplay(QWidget* parent) // that TerminalDisplay will handle repainting its entire area. setAttribute(Qt::WA_OpaquePaintEvent); - _gridLayout = new QGridLayout(this); + _gridLayout = new QGridLayout; _gridLayout->setContentsMargins(0, 0, 0, 0); setLayout(_gridLayout); @@ -448,9 +448,6 @@ TerminalDisplay::~TerminalDisplay() disconnect(_blinkCursorTimer); delete[] _image; - - delete _gridLayout; - delete _outputSuspendedLabel; delete _filterChain; } @@ -3067,8 +3064,7 @@ void TerminalDisplay::outputSuspended(bool suspended) "suspended" " by pressing Ctrl+S." " Press Ctrl+Q to resume." - " Click here to dismiss this message."), - this); + " Click here to dismiss this message.")); QPalette palette(_outputSuspendedLabel->palette()); KColorScheme::adjustBackground(palette, KColorScheme::NeutralBackground);