]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL11830:
authorenk <enk@opencascade.com>
Fri, 10 Mar 2006 09:35:28 +0000 (09:35 +0000)
committerenk <enk@opencascade.com>
Fri, 10 Mar 2006 09:35:28 +0000 (09:35 +0000)
Incorrect title of the warning dialog box

src/VISUGUI/VisuGUI_TimeAnimation.cxx

index fe72f1dd16a3656c3e67d6b480e75d94a1048f8d..c56ed5d97f8be66d6c5afc84e0e71f7ea7da3e0d 100644 (file)
@@ -93,7 +93,7 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator)
 ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow)
   : QDialog(theParent, "ArrangeDlg", true, WStyle_Customize |
             WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
-    myAnimator(0), myViewWindow(theViewWindow)
+    myAnimator(NULL), myViewWindow(theViewWindow)
 {
   myCurrent = 0;
   init();
@@ -245,7 +245,7 @@ void ArrangeDlg::init()
 
 void ArrangeDlg::accept()
 {
-  if (myAnimator) {
+  if (myAnimator != NULL) {
     acceptAnimation();
   } else {
     acceptViewWindow();
@@ -1159,7 +1159,10 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
 //------------------------------------------------------------------------
 VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg()
 {
-  delete myAnimator;
+  if(myAnimator != NULL){
+    delete myAnimator;
+    myAnimator = NULL;
+  }
 }
 
 //------------------------------------------------------------------------
@@ -1275,11 +1278,23 @@ void VisuGUI_TimeAnimationDlg::showEvent(QShowEvent* theEvent)
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent)
 {
-  myAnimator->stopAnimation();
-  myAnimator->wait(500);
-  if (myAnimator->running() && (! myAnimator->finished())) {
-    isClosing = true;
-    myEvent = theEvent;
+  if(myAnimator != NULL){
+    myAnimator->stopAnimation();
+    myAnimator->wait(500);
+    if (myAnimator->running() && (! myAnimator->finished())) {
+      isClosing = true;
+      myEvent = theEvent;
+      //        * Destroing data in myAnimator before study closed.
+      //        * It needed for correcting destroing of myAnimator, which 
+      //        * depend from SVTK_RenderWindowInteractor() e.t.c.
+      if(theEvent->type() == QEvent::Close){
+       for (int i = 0; i < myAnimator->getNbFields(); i++)
+         myAnimator->clearData(myAnimator->getFieldData(i));
+       myAnimator->clearFieldData();
+      }
+    } else {
+      QDialog::closeEvent(theEvent);
+    }
   } else {
     QDialog::closeEvent(theEvent);
   }