[gnome-sudoku] Fix critical warning when starting a new game
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sudoku] Fix critical warning when starting a new game
- Date: Mon, 15 Sep 2014 21:43:32 +0000 (UTC)
commit cd1737fe48d1cc873152419a4000a40bee7745f6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Mon Sep 15 16:43:16 2014 -0500
Fix critical warning when starting a new game
GLib-CRITICAL **: g_timer_continue: assertion 'timer->active == FALSE'
failed
src/gnome-sudoku.vala | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-sudoku.vala b/src/gnome-sudoku.vala
index 0786e0c..d0bcda1 100644
--- a/src/gnome-sudoku.vala
+++ b/src/gnome-sudoku.vala
@@ -283,8 +283,8 @@ public class Sudoku : Gtk.Application
header_bar_subtitle = board.difficulty_category.to_string ();
- game = new SudokuGame (board);
back_cb ();
+ game = new SudokuGame (board);
game.tick.connect (tick_cb);
game.paused_changed.connect (paused_changed_cb);
@@ -397,15 +397,18 @@ public class Sudoku : Gtk.Application
private void back_cb ()
{
main_stack.set_visible_child_name ("frame");
- clear_action.set_enabled (!game.board.is_empty ());
back_button.visible = false;
undo_redo_box.visible = true;
header_bar.set_subtitle (header_bar_subtitle);
print_action.set_enabled (true);
clock_label.show ();
clock_image.show ();
+
if (game != null)
+ {
game.continue_clock ();
+ clear_action.set_enabled (!game.board.is_empty ());
+ }
}
private void undo_cb ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]