[gnome-nibbles/arnaudb/rework-warps: 12/18] Add a security.



commit f8ebeb0a64c6d2ca3db1c8e318a5c44fb7d8931c
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sun Jun 21 23:50:54 2020 +0200

    Add a security.

 src/warp.vala | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/warp.vala b/src/warp.vala
index 4ba6850..69b9314 100644
--- a/src/warp.vala
+++ b/src/warp.vala
@@ -23,6 +23,8 @@ private class WarpManager: Object
 {
     private class Warp : Object
     {
+        private bool init_finished = false;
+
         public int id       { internal get; protected construct; }
 
         public int source_x { internal get; protected construct set; }
@@ -46,15 +48,19 @@ private class WarpManager: Object
         }
 
         internal void set_source (int x, int y)
+            requires (init_finished == false)
         {
             source_x = x;
             source_y = y;
+            init_finished = true;
         }
 
         internal void set_target (int x, int y)
+            requires (init_finished == false)
         {
             target_x = x;
             target_y = y;
+            init_finished = true;
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]