mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
remove deleted games from games list
Was getting crashes since they could still be looked up
This commit is contained in:
parent
61be81cf1a
commit
ffc42ed5e0
1 changed files with 12 additions and 0 deletions
|
@ -528,9 +528,21 @@ cleanupGame( GameState* gs )
|
|||
static void
|
||||
deleteGame( GameState* gs )
|
||||
{
|
||||
Globals* globals = gs->globals;
|
||||
int gameID = gs->gi.gameID; /* remember it */
|
||||
cleanupGame( gs );
|
||||
|
||||
// Remove from linked list, but don't actually free because could live in
|
||||
// a js-side object still. Needs refcounting or somesuch
|
||||
GameState** prev = &globals->games;
|
||||
for ( GameState* cur = globals->games; !!cur; cur = cur->next ) {
|
||||
if ( gs == cur ) {
|
||||
*prev = cur->next;
|
||||
break;
|
||||
}
|
||||
prev = &cur->next;
|
||||
}
|
||||
|
||||
char key[32];
|
||||
formatNameKey( key, sizeof(key), gameID );
|
||||
remove_stored_value( key );
|
||||
|
|
Loading…
Add table
Reference in a new issue