diff options
3 files changed, 10 insertions, 7 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp index 5ae671d87..0ce7df00a 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp @@ -819,9 +819,11 @@ bool AbstractMetaFunction::allowThread() const case TypeSystem::AllowThread::Allow: break; case TypeSystem::AllowThread::Auto: - case TypeSystem::AllowThread::Unspecified: result = autoDetectAllowThread(); break; + case TypeSystem::AllowThread::Unspecified: + result = false; + break; } if (!result) qCDebug(lcShiboken).noquote() << msgDisallowThread(this); diff --git a/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp b/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp index 922f1c23f..4fd4269f6 100644 --- a/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testmodifyfunction.cpp @@ -256,9 +256,9 @@ struct A { // Nothing specified, true const AbstractMetaFunction *f1 = classA->findFunction(QLatin1String("f1")); QVERIFY(f1); - QVERIFY(f1->allowThread()); + QVERIFY(!f1->allowThread()); - // 'auto' specified, should be true for nontrivial function + // 'auto' specified, should be false for nontrivial function const AbstractMetaFunction *f2 = classA->findFunction(QLatin1String("f2")); QVERIFY(f2); QVERIFY(f2->allowThread()); @@ -349,7 +349,7 @@ struct A : public Base { <object-type name='A'/> </typesystem>)XML") << false << false << false // exception - << true; // allowthread + << false; // allowthread // Modify one function QTest::newRow("modify-function1") @@ -363,7 +363,7 @@ struct A : public Base { </object-type> </typesystem>)XML") << false << false << true // exception - << true; // allowthread + << false; // allowthread // Flip defaults by modifying functions QTest::newRow("modify-function2") @@ -378,7 +378,7 @@ struct A : public Base { </object-type> </typesystem>)XML") << true << false << false // exception - << true; // allowthread + << false; // allowthread // Activate on type system level QTest::newRow("typesystem-on") @@ -428,7 +428,7 @@ struct A : public Base { </object-type> </typesystem>)XML") << true << false << false // exception - << true; // allowthread + << false; // allowthread } void TestModifyFunction::testScopedModifications() diff --git a/sources/shiboken2/doc/typesystem_manipulating_objects.rst b/sources/shiboken2/doc/typesystem_manipulating_objects.rst index c04a4fa27..f76289bc4 100644 --- a/sources/shiboken2/doc/typesystem_manipulating_objects.rst +++ b/sources/shiboken2/doc/typesystem_manipulating_objects.rst @@ -119,6 +119,7 @@ modify-function lengthy I/O operations or similar. It has performance costs, though. The value ``auto`` means that it will be turned off for functions for which it is deemed to be safe, for example, simple getters. + The attribute defaults to ``false``. The ``exception-handling`` attribute specifies whether to generate exception handling code (nest the function call into try / catch statements). It accepts |
