[gnome-nibbles/arnaudb/rework-warps: 5/8] Add a security.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/rework-warps: 5/8] Add a security.
- Date: Sun, 21 Jun 2020 23:42:32 +0000 (UTC)
commit 8336ec0b775a8fbe638316c18f39b48a871fc7ea
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]