From 8d7e6620224432b0bfc9f165b8559f65a43cb2c5 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sat, 9 Mar 2019 12:41:31 -0600 Subject: [PATCH] Remove memory management patch which causes crashes. --- debian/changelog | 1 + ...ry-management-filter-related-objects.patch | 171 ------------------ debian/patches/series | 1 - 3 files changed, 1 insertion(+), 172 deletions(-) delete mode 100644 debian/patches/rework-memory-management-filter-related-objects.patch delete mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index 02d8c2c..20aa2d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ qtermwidget (0.14.1-0ubuntu1) UNRELEASED; urgency=medium * New upstream release. + * Remove memory management patch which causes crashes. -- Simon Quigley Sat, 09 Mar 2019 12:40:57 -0600 diff --git a/debian/patches/rework-memory-management-filter-related-objects.patch b/debian/patches/rework-memory-management-filter-related-objects.patch deleted file mode 100644 index 7f33499..0000000 --- a/debian/patches/rework-memory-management-filter-related-objects.patch +++ /dev/null @@ -1,171 +0,0 @@ -Description: Rework memory management of filter-related objects -Author: Yen Chi Hsuan -Origin: upstream -Bug: https://github.com/lxqt/qterminal/issues/358 -Applied-Upstream: commit:0154e03 -Last-Update: 2018-07-10 ---- a/lib/Filter.cpp -+++ b/lib/Filter.cpp -@@ -22,6 +22,7 @@ - - // System - #include -+#include - - // Qt - #include -@@ -195,7 +196,15 @@ Filter::~Filter() - } - void Filter::reset() - { -- qDeleteAll(_hotspotList); -+ QListIterator iter(_hotspotList); -+ while (iter.hasNext()) -+ { -+ HotSpot* currentHotSpot = iter.next(); -+ if (currentHotSpot->hasAnotherParent()) { -+ continue; -+ } -+ delete currentHotSpot; -+ } - _hotspots.clear(); - _hotspotList.clear(); - } -@@ -287,10 +296,13 @@ Filter::HotSpot::HotSpot(int startLine , - , _endLine(endLine) - , _endColumn(endColumn) - , _type(NotSpecified) -+ , _hasAnotherParent(false) - { - } --QList Filter::HotSpot::actions() -+QList Filter::HotSpot::actions(QWidget* parent) - { -+ Q_UNUSED(parent); -+ - return QList(); - } - int Filter::HotSpot::startLine() const -@@ -502,14 +514,28 @@ FilterObject* UrlFilter::HotSpot::getUrl - return _urlObject; - } - --QList UrlFilter::HotSpot::actions() -+class UrlAction : public QAction { -+public: -+ UrlAction(QWidget* parent, std::shared_ptr hotspotPtr) -+ : QAction(parent) -+ , _hotspotPtr(hotspotPtr) -+ { -+ } -+ -+private: -+ std::shared_ptr _hotspotPtr; -+}; -+ -+QList UrlFilter::HotSpot::actions(QWidget* parent) - { -+ this->_hasAnotherParent = true; - QList list; - - const UrlType kind = urlType(); - -- QAction* openAction = new QAction(_urlObject); -- QAction* copyAction = new QAction(_urlObject);; -+ std::shared_ptr hotspotPtr(this); -+ UrlAction* openAction = new UrlAction(parent, hotspotPtr); -+ UrlAction* copyAction = new UrlAction(parent, hotspotPtr); - - Q_ASSERT( kind == StandardUrl || kind == Email ); - ---- a/lib/Filter.h -+++ b/lib/Filter.h -@@ -115,19 +115,22 @@ public: - * Returns a list of actions associated with the hotspot which can be used in a - * menu or toolbar - */ -- virtual QList actions(); -+ virtual QList actions(QWidget* parent); -+ -+ bool hasAnotherParent() const { return _hasAnotherParent; } - - protected: - /** Sets the type of a hotspot. This should only be set once */ - void setType(Type type); - -+ bool _hasAnotherParent; -+ - private: - int _startLine; - int _startColumn; - int _endLine; - int _endColumn; - Type _type; -- - }; - - /** Constructs a new filter. */ -@@ -256,7 +259,7 @@ public: - - FilterObject* getUrlObject() const; - -- virtual QList actions(); -+ virtual QList actions(QWidget* parent); - - /** - * Open a web browser at the current URL. The url itself can be determined using ---- a/lib/TerminalDisplay.cpp -+++ b/lib/TerminalDisplay.cpp -@@ -1957,14 +1957,14 @@ void TerminalDisplay::mousePressEvent(QM - } - } - --QList TerminalDisplay::filterActions(const QPoint& position) -+QList TerminalDisplay::filterActions(const QPoint& position, QWidget* parent) - { - int charLine, charColumn; - getCharacterPosition(position,charLine,charColumn); - - Filter::HotSpot* spot = _filterChain->hotSpotAt(charLine,charColumn); - -- return spot ? spot->actions() : QList(); -+ return spot ? spot->actions(parent) : QList(); - } - - void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev) ---- a/lib/TerminalDisplay.h -+++ b/lib/TerminalDisplay.h -@@ -158,7 +158,7 @@ public: - * Returns a list of menu actions created by the filters for the content - * at the given @p position. - */ -- QList filterActions(const QPoint& position); -+ QList filterActions(const QPoint& position, QWidget* parent); - - /** Returns true if the cursor is set to blink or false otherwise. */ - bool blinkingCursor() { return _hasBlinkingCursor; } ---- a/lib/qtermwidget.cpp -+++ b/lib/qtermwidget.cpp -@@ -694,9 +694,9 @@ Filter::HotSpot* QTermWidget::getHotSpot - return m_impl->m_terminalDisplay->filterChain()->hotSpotAt(row, column); - } - --QList QTermWidget::filterActions(const QPoint& position) -+QList QTermWidget::filterActions(const QPoint& position, QWidget* parent) - { -- return m_impl->m_terminalDisplay->filterActions(position); -+ return m_impl->m_terminalDisplay->filterActions(position, parent); - } - - int QTermWidget::getPtySlaveFd() const ---- a/lib/qtermwidget.h -+++ b/lib/qtermwidget.h -@@ -186,7 +186,7 @@ public: - /* - * Proxy for TerminalDisplay::filterActions - * */ -- QList filterActions(const QPoint& position); -+ QList filterActions(const QPoint& position, QWidget* parent); - - /** - * Returns a pty slave file descriptor. diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 3258f55..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -rework-memory-management-filter-related-objects.patch