summaryrefslogtreecommitdiff
path: root/libgame
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2006-05-11 21:25:01 +0000
committerBenjamin Otte <otte@gnome.org>2006-05-11 21:25:01 +0000
commit72dfd742bf240ca2f56d9e43dac5448e702932d1 (patch)
treeb5b4c72d69dff2e023c9e0e980b08e147cd9dfbf /libgame
parenta7bd3ee417fcac9acaa8d93987f66bf64cad42c9 (diff)
* libgame/game-match.c: (game_match_tick_cb):
ref/unref-guard the match during the tick function, as it may go away in there * libgame/game-network.c: (game_network_match_close_connection): only change status when the connection had an error
Diffstat (limited to 'libgame')
-rw-r--r--libgame/game-match.c2
-rw-r--r--libgame/game-network.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/libgame/game-match.c b/libgame/game-match.c
index 34237a0..a5ef104 100644
--- a/libgame/game-match.c
+++ b/libgame/game-match.c
@@ -41,7 +41,9 @@ game_match_tick_cb (gpointer data)
GameMatchClass *klass = GAME_MATCH_GET_CLASS (match);
g_return_val_if_fail (klass->tick != NULL, TRUE);
+ g_object_ref (match);
klass->tick (match);
+ g_object_unref (match);
return TRUE;
}
diff --git a/libgame/game-network.c b/libgame/game-network.c
index ecaffd4..9181ac0 100644
--- a/libgame/game-network.c
+++ b/libgame/game-network.c
@@ -510,7 +510,7 @@ game_network_match_close_connection (GameNetworkMatch *match,
connection->players = NULL;
connection->match = NULL;
- if (match->connections == NULL && !match->host)
+ if (match->connections == NULL && !match->host && connection->error)
game_network_match_status (match, _("Connection terminated."));
gnet_conn_disconnect (connection->conn);
g_object_unref (connection);