소스 검색

ctkVTKAbstractView: Skip rendering if widget is not valid

Jean-Christophe Fillion-Robin 7 년 전
부모
커밋
71c631511c
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp

+ 8 - 0
Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp

@@ -219,6 +219,14 @@ void ctkVTKAbstractView::forceRender()
 {
   Q_D(ctkVTKAbstractView);
 
+  // avoid calling render if the widget isn't valid, i.e. if the context isn't
+  // ready yet. This is due to asynchronous initialization of the context by
+  // the pqQVTKWidgetBase class.
+  if (!d->VTKWidget->isValid())
+    {
+    return;
+    }
+
   if (this->sender() == d->RequestTimer  &&
       !d->RequestTime.isValid())
     {