fix crashes and bugs in linux apps

This commit is contained in:
Eric House 2020-02-05 17:04:22 -08:00
parent 6b41628fbf
commit ac4baff7e7
3 changed files with 10 additions and 6 deletions

View file

@ -126,6 +126,7 @@ cb_new( CursesBoardState* cbState, const cb_dims* dims )
{
CursesBoardGlobals* bGlobals = findOrOpen( cbState, -1, NULL, NULL );
if ( !!bGlobals ) {
initMenus( bGlobals );
enableDraw( bGlobals, dims );
setupBoard( bGlobals );
}
@ -864,9 +865,11 @@ curses_util_informMove( XW_UtilCtxt* uc, XP_S16 XP_UNUSED(turn),
XWStreamCtxt* expl, XWStreamCtxt* XP_UNUSED(words))
{
CursesBoardGlobals* bGlobals = (CursesBoardGlobals*)uc->closure;
char* question = strFromStream( expl );
(void)ca_inform( bGlobals->boardWin, question );
free( question );
if ( !!bGlobals->boardWin ) {
char* question = strFromStream( expl );
(void)ca_inform( bGlobals->boardWin, question );
free( question );
}
}
static void

View file

@ -602,7 +602,9 @@ handle_winchwrite( GIOChannel* source, GIOCondition condition, gpointer data )
cgl_resized( aGlobals->gameList, g_globals.winWidth,
g_globals.cag.params->cursesListWinHt );
cmenu_resized( aGlobals->menuState );
if ( !!aGlobals->menuState ) {
cmenu_resized( aGlobals->menuState );
}
cb_dims dims;
figureDims( aGlobals, &dims );

View file

@ -1195,7 +1195,7 @@ parseSMSParams( LaunchParams* params, gchar** myPhone, XP_U16* myPort )
gchar buf[32];
const XP_UCHAR* phone = params->connInfo.sms.myPhone;
if ( !!phone ) {
db_store( params->pDb, KEY_SMSPHONE, *myPhone );
db_store( params->pDb, KEY_SMSPHONE, phone );
*myPhone = g_strdup( phone );
} else if ( !phone && db_fetch_safe( params->pDb, KEY_SMSPHONE, buf, VSIZE(buf) ) ) {
params->connInfo.sms.myPhone = *myPhone = g_strdup(buf);
@ -2379,7 +2379,6 @@ assertDrawCallbacksSet( const DrawCtxVTable* vtable )
bool allSet = true;
void(**proc)() = (void(**)())vtable;
for ( int ii = 0; ii < sizeof(*vtable)/sizeof(*proc); ++ii ) {
XP_LOGFF( "looking at index %d", ii );
if ( !*proc ) {
XP_LOGF( "%s(): null ptr at index %d", __func__, ii );
allSet = false;