HomePhabricator
Diffusion MITK bc70fcca1f66

Make use of GetRenderWindowPart() more robust

Description

Make use of GetRenderWindowPart() more robust

Summary:

  • Do nullptr checks for optional use
  • Use OPEN strategy for mandatory use

Ref T28341

edit: In theory, GetRenderWindow(OPEN) still could return a nullptr if MITK was compiled without a render window editor. In this case most of the touched files would horribly fail anyway, as the presence of render windows is assumed. Also a user may be unlucky and close the render window editor right in the microsecond between two uses of a render window part raw pointer. This can only be solved by changing the return type to a reference counting smart pointer. All these theoretical issues never turned out to be a real problem so I chose the pragmatic way of either doing nullptr checks or simply using OPEN without an additional check.

Test Plan: Manually test views with in-app help in foreground or closed render window editor

Reviewers: thomass, O3 MITK Reviewer Group II, O1 MITK Reviewer Group I, floca

Reviewed By: thomass, O3 MITK Reviewer Group II, O1 MITK Reviewer Group I, floca

Maniphest Tasks: T28341

Differential Revision: https://phabricator.mitk.org/D473

Details

Provenance
kislinskAuthored on Mar 2 2021, 10:55 AM
kislinskPushed on Mar 2 2021, 11:12 PM
Reviewer
O3: MITK Reviewer Group II
Differential Revision
Restricted Differential Revision
Parents
rMITK288ecbcf8528: Make use of GetRenderWindowPart() more robust
rMITK7014777eedae: Preserve color selection
Branches
Unknown
Tags
Unknown
Tasks
T28341: Crashes when using plugin with documentation opened (in MatchPoint,Modelfit,..)