summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm
index 43f36e32e0..7b217e0bdc 100644
--- a/src/plugins/platforms/ios/qioswindow.mm
+++ b/src/plugins/platforms/ios/qioswindow.mm
@@ -341,7 +341,8 @@
// Resigning first responed status means that the virtual keyboard was closed, or
// some other view became first responder. In either case we clear the focus object to
// avoid blinking cursors in line edits etc:
- static_cast<QWindowPrivate *>(QObjectPrivate::get(m_qioswindow->window()))->clearFocusObject();
+ if (m_qioswindow)
+ static_cast<QWindowPrivate *>(QObjectPrivate::get(m_qioswindow->window()))->clearFocusObject();
return [super resignFirstResponder];
}
@@ -423,8 +424,10 @@
- (QWindow *)qwindow
{
- if ([self isKindOfClass:[QUIView class]])
- return static_cast<QUIView *>(self)->m_qioswindow->window();
+ if ([self isKindOfClass:[QUIView class]]) {
+ if (QIOSWindow *w = static_cast<QUIView *>(self)->m_qioswindow)
+ return w->window();
+ }
return nil;
}
@@ -461,6 +464,7 @@ QIOSWindow::~QIOSWindow()
// cancellation of all touch events.
[m_view touchesCancelled:0 withEvent:0];
+ m_view->m_qioswindow = 0;
[m_view removeFromSuperview];
[m_view release];
}