> When closing gallery, the qmlscene does not exit (the prompt in terminal is
> not retrieved).
Actually the following code causes the trouble:
419 +QObject* QuickUtils::createQmlObject(const QUrl &url)
420 +{
421 + /* FIXME: if the directory pointed to by url contains a qmldir file that
422 + declares a JavaScript module then QQmlComponent::create() fails with
423 + the error "QQmlComponent: Component is not ready".
424 + */
425 + static QQmlEngine engine;
426 + QQmlComponent *component = new QQmlComponent(&engine, url, QQmlComponent::PreferSynchronous);
427 + QObject* result = component->create();
428 + delete component;
429 + return result;
430 +}
Having a quick look on the call stack seems to hang on the static QQmlEngien cleanup:
So the static QQmlEngine causes the hang when closing qmlscene. I did some small prototyping with using the plugin's QmlEngine, but then a second call on createQmlObject() causes "QQmlComponent: Component not ready" error, which is somewhat anticipated as we are trying to instantiate a component in the plugin's registration stage (we had this kind of error in the early times of the plugin creation with the theming engine).
Connecting the static engine's quit() signal to the parent one's does not help either. Therefore seems we need a different way of creating the UbuntuColors component.
> When closing gallery, the qmlscene does not exit (the prompt in terminal is
> not retrieved).
Actually the following code causes the trouble: :createQmlObjec t(const QUrl &url) :create( ) fails with &engine, url, QQmlComponent: :PreferSynchron ous); >create( );
419 +QObject* QuickUtils:
420 +{
421 + /* FIXME: if the directory pointed to by url contains a qmldir file that
422 + declares a JavaScript module then QQmlComponent:
423 + the error "QQmlComponent: Component is not ready".
424 + */
425 + static QQmlEngine engine;
426 + QQmlComponent *component = new QQmlComponent(
427 + QObject* result = component-
428 + delete component;
429 + return result;
430 +}
Having a quick look on the call stack seems to hang on the static QQmlEngien cleanup:
0 pthread_ cond_wait@ @GLIBC_ 2.3.2 185 0x7ffff4815ca4 :wait(QMutex* , unsigned long) /usr/lib/ x86_64- linux-gnu/ libQt5Core. so.5 0x7ffff611e4fb x86_64- linux-gnu/ libQt5Qml. so.5 0x7ffff75a940a x86_64- linux-gnu/ libQt5Qml. so.5 0x7ffff75398f9 te::~QQmlEngine Private( ) /usr/lib/ x86_64- linux-gnu/ libQt5Qml. so.5 0x7ffff74e76d3 te::~QQmlEngine Private( ) /usr/lib/ x86_64- linux-gnu/ libQt5Qml. so.5 0x7ffff74e7ab9 x86_64- linux-gnu/ libQt5Core. so.5 0x7ffff62c5398 :~QQmlEngine( ) /usr/lib/ x86_64- linux-gnu/ libQt5Qml. so.5 0x7ffff74e40a9
1 QWaitCondition:
2 ?? /usr/lib/
3 ?? /usr/lib/
4 QQmlEnginePriva
5 QQmlEnginePriva
6 QObject::~QObject() /usr/lib/
7 QQmlEngine:
8 __run_exit_handlers 77 0x7ffff5701121
9 __GI_exit 99 0x7ffff57011a5
10 __libc_start_main 294 0x7ffff56e6eac
11 ?? 0x40629d
So the static QQmlEngine causes the hang when closing qmlscene. I did some small prototyping with using the plugin's QmlEngine, but then a second call on createQmlObject() causes "QQmlComponent: Component not ready" error, which is somewhat anticipated as we are trying to instantiate a component in the plugin's registration stage (we had this kind of error in the early times of the plugin creation with the theming engine).
Connecting the static engine's quit() signal to the parent one's does not help either. Therefore seems we need a different way of creating the UbuntuColors component.