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();
void ArrangeDlg::accept()
{
- if (myAnimator) {
+ if (myAnimator != NULL) {
acceptAnimation();
} else {
acceptViewWindow();
//------------------------------------------------------------------------
VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg()
{
- delete myAnimator;
+ if(myAnimator != NULL){
+ delete myAnimator;
+ myAnimator = NULL;
+ }
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
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);
}