pmc/cube.cc
changeset 34 4a35f239fe5b
parent 9 c3fecc82ade6
child 35 024c2932a31f
--- a/pmc/cube.cc
+++ b/pmc/cube.cc
@@ -32,8 +32,12 @@
 
 void Cube::move (Vector location)
 {
+	Vector *p_tmp;
+
     for (int i = 0; i < 8; i++) {
-        P[i] = new Vector (*P[i] + location);
+        p_tmp = new Vector (*P[i] + location);
+		delete P[i];
+		P[i] = p_tmp;
     }
 }