summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@digia.com>2014-09-09 10:26:26 +0200
committerChristian Stromme <christian.stromme@digia.com>2014-09-09 10:38:22 +0200
commit2efc21e6539ad555d0a9ef6848a163552d2ecdee (patch)
treea3c9170419bff13eb4bf058e61ca56fa157ea745
parentc08eef29b45646643535e917f70492727160720b (diff)
Add dtor in QWindowControllerItem.
Both the base and Android implementation needs to clean-up their resources on destruction. Change-Id: I504ed781bc8400afb044ed54c5fbe13daf8c917d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r--src/webview/qwindowcontrolleritem.cpp6
-rw-r--r--src/webview/qwindowcontrolleritem_ios.mm5
-rw-r--r--src/webview/qwindowcontrolleritem_p.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/src/webview/qwindowcontrolleritem.cpp b/src/webview/qwindowcontrolleritem.cpp
index 5abd624..b2d3800 100644
--- a/src/webview/qwindowcontrolleritem.cpp
+++ b/src/webview/qwindowcontrolleritem.cpp
@@ -47,8 +47,14 @@ QWindowControllerItem::QWindowControllerItem(QQuickItem *parent)
connect(this, SIGNAL(visibleChanged()), this, SLOT(onVisibleChanged()));
}
+QWindowControllerItem::~QWindowControllerItem()
+{
+ delete m_controlledWindow;
+}
+
void QWindowControllerItem::setNativeWindow(WId windowId)
{
+ Q_ASSERT(m_controlledWindow == 0);
m_controlledWindow = QWindow::fromWinId(windowId);
m_controlledWindow->setVisibility(QWindow::Windowed);
}
diff --git a/src/webview/qwindowcontrolleritem_ios.mm b/src/webview/qwindowcontrolleritem_ios.mm
index be22e59..c957537 100644
--- a/src/webview/qwindowcontrolleritem_ios.mm
+++ b/src/webview/qwindowcontrolleritem_ios.mm
@@ -56,6 +56,11 @@ QWindowControllerItem::QWindowControllerItem(QQuickItem *parent)
connect(this, SIGNAL(visibleChanged()), this, SLOT(onVisibleChanged()));
}
+QWindowControllerItem::~QWindowControllerItem()
+{
+
+}
+
void QWindowControllerItem::setNativeWindow(WId windowId)
{
m_controlledUIView = reinterpret_cast<UIView *>(windowId);
diff --git a/src/webview/qwindowcontrolleritem_p.h b/src/webview/qwindowcontrolleritem_p.h
index 83c7346..03ec464 100644
--- a/src/webview/qwindowcontrolleritem_p.h
+++ b/src/webview/qwindowcontrolleritem_p.h
@@ -61,6 +61,7 @@ class Q_WEBVIEW_EXPORT QWindowControllerItem : public QQuickItem
Q_OBJECT
public:
explicit QWindowControllerItem(QQuickItem *parent = 0);
+ ~QWindowControllerItem();
void setNativeWindow(WId windowId);
void componentComplete();
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);