Merge pull request #11075 from jherico/tablet_scripting_crash

Fix tablet button crash
This commit is contained in:
anshuman64 2017-07-28 11:57:27 -07:00 committed by GitHub
commit defc76c9cf

View file

@ -825,7 +825,13 @@ TabletButtonProxy::~TabletButtonProxy() {
void TabletButtonProxy::setQmlButton(QQuickItem* qmlButton) {
Q_ASSERT(QThread::currentThread() == qApp->thread());
if (_qmlButton) {
QObject::disconnect(_qmlButton, &QQuickItem::destroyed, this, nullptr);
}
_qmlButton = qmlButton;
if (_qmlButton) {
QObject::connect(_qmlButton, &QQuickItem::destroyed, this, [this] { _qmlButton = nullptr; });
}
}
void TabletButtonProxy::setToolbarButtonProxy(QObject* toolbarButtonProxy) {