Commit 77c94d07 authored by BogDan Vatra's avatar BogDan Vatra Committed by Jani Heikkinen
Browse files

Delay QtAndroidPrivate::setOnBindListener call until the QAndroidService constructor exits


If we call QtAndroidPrivate::setOnBindListener before QAndroidService constructor exits the virtual table
is not set and m_service->onBind will call the wrong method.

Task-number: QTBUG-66222
Change-Id: I3d057e33dd36a317c5605d7eb5d6892827ad7b13
Reviewed-by: default avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
parent 7fb85fcb
Branches
Tags
No related merge requests found
Showing with 2 additions and 1 deletion
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <private/qjnihelpers_p.h> #include <private/qjnihelpers_p.h>
#include <QMutex> #include <QMutex>
#include <QTimer>
#include <QSet> #include <QSet>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
...@@ -56,7 +57,7 @@ public: ...@@ -56,7 +57,7 @@ public:
QAndroidServicePrivate(QAndroidService *service) QAndroidServicePrivate(QAndroidService *service)
: m_service(service) : m_service(service)
{ {
QtAndroidPrivate::setOnBindListener(this); QTimer::singleShot(0,this, [this]{ QtAndroidPrivate::setOnBindListener(this);});
} }
~QAndroidServicePrivate() ~QAndroidServicePrivate()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment