Screen will turn black after 30 min
[chessclock] / chessclockwindow.cpp
index 2a7c7cb..c5fde01 100644 (file)
@@ -25,6 +25,7 @@
 #include "classes/chessclockwidget.h"
 #include "classes/startwidget.h"
 #include "classes/timecontrol.h"
+#include "classes/turninformation.h"
 
 // Time controls
 #include "classes/timecontrol/notimecontrol.h"
@@ -144,6 +145,7 @@ void ChessClockWindow::startGame(TimeControl *timecontrol)
         clocks_ = newWidget;
         stack_->addWidget(clocks_);
         stack_->setCurrentWidget(clocks_);
+        connect( clocks_, SIGNAL(TurnFinished(TurnInformation*)), this, SLOT(dontEatMemory(TurnInformation*)));
     }
 }
 
@@ -163,3 +165,8 @@ bool ChessClockWindow::eventFilter(QObject *obj, QEvent *event)
         return QObject::eventFilter(obj, event);
     }
 }
+
+void ChessClockWindow::dontEatMemory(TurnInformation *turnInformation)
+{
+    delete turnInformation; // hopefully don't cause Segematation Fault
+}