fix(designer): avoid touching deleted widgets during init as QtDesigner will segfault
Description
Designer randomly segfaults on pre_release. It seems as if this is caused by the _enforce_unique_sibling_name
method as it accesses all widgets and thus may also try to access widgets that have been marked for deletion by QtDesigner. However, it appears to be sufficient to move these checks outside of __init__
. Here, I achieved this by using a single shot timer. In addition, I'm checking for deleted widgets before trying to access them. However, moving it to a single shot meant that the object is created and potentially returned through rpc before it is even registered. To remedy this, commit 0463b32d introduces a check to ensure that the serialized object is a valid entry in the registry.
While I was at it, I also fixed the TODOs in BECConnector (#475 (closed), #472 (closed))
Related Issues
closes #484 (closed) #475 (closed) #472 (closed)
Additional Comments
Please try to play around with QtDesigner a bit. For me, the segfaults happened when clicking on the plugins.
If this MR really solves the problem, we should double-check that we are not accessing other widgets or even all widgets in other __init__
methods.
Definition of Done
-
Documentation is up-to-date.
Merge request reports
Activity
assigned to @wakonig_k
added 4 commits
- 7e82e090 - fix(bec_connector): move RPC registration into single shot method to ensure the rpc name is in sync
- e9d062c1 - fix(bec_connector): add assertion to ensure BECConnector is used with a QObject; closes #475 (closed)
- 0a0233f9 - fix(rpc_register): change add_rpc parameter type to BECConnector and add...
- 44cbc8e0 - fix(bec_connector): add setObjectName method to update object name and...
Toggle commit listadded 1 commit
- 0463b32d - fix(rpc_server): update _serialize_bec_connector to include wait parameter for registration check
added 9 commits
-
0463b32d...ac9224e5 - 3 commits from branch
pre_release_v2
- e435c61c - fix(designer): avoid touching deleted widgets during init as QtDesigner will segfault
- f836063c - fix(bec_connector): move RPC registration into single shot method to ensure the rpc name is in sync
- 51dd49b2 - fix(bec_connector): add assertion to ensure BECConnector is used with a QObject; closes #475 (closed)
- 622dc4ee - fix(rpc_register): change add_rpc parameter type to BECConnector and add...
- 36f8e805 - fix(bec_connector): add setObjectName method to update object name and...
- 5fd0be96 - fix(rpc_server): update _serialize_bec_connector to include wait parameter for registration check
Toggle commit list-
0463b32d...ac9224e5 - 3 commits from branch
added 7 commits
-
e4e9febc - 1 commit from branch
pre_release_v2
- 4381fcc4 - fix(designer): avoid touching deleted widgets during init as QtDesigner will segfault
- 3b16c9f5 - fix(bec_connector): move RPC registration into single shot method to ensure the rpc name is in sync
- 1921444e - fix(bec_connector): add assertion to ensure BECConnector is used with a QObject; closes #475 (closed)
- 82b82659 - fix(rpc_register): change add_rpc parameter type to BECConnector and add...
- 064343ac - fix(bec_connector): add setObjectName method to update object name and...
- d6fccd10 - fix(rpc_server): update _serialize_bec_connector to include wait parameter for registration check
Toggle commit list-
e4e9febc - 1 commit from branch