[gnome-chess] Workaround signal misfires that led to crash
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Workaround signal misfires that led to crash
- Date: Mon, 23 Jun 2014 01:34:33 +0000 (UTC)
commit a3f1007fe7ea7270c188798e61cd4b7e7c00190e
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Jun 22 20:20:10 2014 -0500
Workaround signal misfires that led to crash
Even though the original ChessGame is always destroyed immediately after
the creation of a new one (no other reference to it exists), the signals
we connected to the original game may be nonetheless fired by the NEW
game object. This must be a bug in Vala signals.
https://bugzilla.gnome.org/show_bug.cgi?id=732067
src/gnome-chess.vala | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 14caf9a..721f7be 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -426,6 +426,17 @@ public class Application : Gtk.Application
else
warning ("Chess game has SetUp tag but no FEN tag");
}
+
+ /* Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=732067 */
+ if (game != null)
+ {
+ game.started.disconnect (game_start_cb);
+ game.turn_started.disconnect (game_turn_cb);
+ game.moved.disconnect (game_move_cb);
+ game.undo.disconnect (game_undo_cb);
+ game.ended.disconnect (game_end_cb);
+ }
+
game = new ChessGame (fen, moves);
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]