Page MenuHomePhabricator

Destruction in berryHelpPluginActivator broken - assertion fails
Closed, ResolvedPublic

Description

I am getting an assertion failure "Cannot send events to objects owned by a different thread. ..." from Qt when quitting mitkWorkbench after having opened the help (via the F1 menu entry).

This is during the destruction of the berryQHelpEngineWrapper which is executing in a different thread (as far as I got it). Such objects should not be deleted like this but using QObject's deleteLater.

QScopedPointer offers a template parameter to specify the usage of deleteLater.

I already fixed the code locally, will publish the branch right away.

error_help_close.pg.JPG (328×511 px, 41 KB)

Event Timeline

User maleike has pushed new remote branch:

bug-19229-berryHelpPluginActivator-deleteLater

[e1c0de]: Merge branch 'bug-19229-berryHelpPluginActivator-deleteLater'

Merged commits:

2015-08-12 11:54:21 Daniel Maleike [dcb5e2]
Use deleteLater() on helpEngine. Avoids a crash.

On Qt4 the instruction QScopedPointerDeleteLater is not available. I reopened the bug.

Jonas, I don't have a Qt4 environment at hand. As you observed this, I assume you do?

I'd suggest a "#ifdef Qt4 .." and then try something like

Object* o = pointer.take();
o->deleteLater();

(in the destructor of the activator class where destruction would otherwise happen automatically via the QScopedPointer)

Could you perhaps try this, please?

User cordes has pushed new remote branch:

bug-19229-fixberryHelpPluginActivatorQScoppedPointerDeleteLater

Hey Daniel, I couldn't reproduce the assertion on osx.
But I pushed a branch with the proposed fix.

Maybe you can take a short look at it. If it's okay I'll merge it asap.

[7128fa]: Merge branch 'bug-19229-fixberryHelpPluginActivatorQScoppedPointerDele

Merged commits:

2015-08-12 19:21:16 Jonas Cordes [f85a28]
Manual call of deleteLater (Qt4 fix)

Hey Daniel, I had to merge it now & thanks for the suggestion!