mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 19:29:54 +02:00
Merge pull request #4706 from ZappoMan/useAvatarCrashFix
fix crash in scripts using useAvatar methods
This commit is contained in:
commit
5fad6b97ff
1 changed files with 16 additions and 0 deletions
|
@ -987,6 +987,13 @@ void MyAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelName) {
|
void MyAvatar::useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelName) {
|
||||||
|
if (QThread::currentThread() != thread()) {
|
||||||
|
QMetaObject::invokeMethod(this, "useFullAvatarURL", Qt::BlockingQueuedConnection,
|
||||||
|
Q_ARG(const QUrl&, fullAvatarURL),
|
||||||
|
Q_ARG(const QString&, modelName));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_useFullAvatar = true;
|
_useFullAvatar = true;
|
||||||
|
|
||||||
if (_fullAvatarURLFromPreferences != fullAvatarURL) {
|
if (_fullAvatarURLFromPreferences != fullAvatarURL) {
|
||||||
|
@ -1019,6 +1026,15 @@ void MyAvatar::useBodyURL(const QUrl& bodyURL, const QString& modelName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::useHeadAndBodyURLs(const QUrl& headURL, const QUrl& bodyURL, const QString& headName, const QString& bodyName) {
|
void MyAvatar::useHeadAndBodyURLs(const QUrl& headURL, const QUrl& bodyURL, const QString& headName, const QString& bodyName) {
|
||||||
|
if (QThread::currentThread() != thread()) {
|
||||||
|
QMetaObject::invokeMethod(this, "useFullAvatarURL", Qt::BlockingQueuedConnection,
|
||||||
|
Q_ARG(const QUrl&, headURL),
|
||||||
|
Q_ARG(const QUrl&, bodyURL),
|
||||||
|
Q_ARG(const QString&, headName),
|
||||||
|
Q_ARG(const QString&, bodyName));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_useFullAvatar = false;
|
_useFullAvatar = false;
|
||||||
|
|
||||||
if (_headURLFromPreferences != headURL) {
|
if (_headURLFromPreferences != headURL) {
|
||||||
|
|
Loading…
Reference in a new issue