fix shutdown panic by disposing fonts

This commit is contained in:
ehouse 2005-03-23 05:47:19 +00:00
parent 8b34f57bf9
commit cf271c4411

View file

@ -102,6 +102,7 @@ typedef struct SymDrawCtxt {
XP_U16 iTrayOwner; XP_U16 iTrayOwner;
XP_Bool iTrayHasFocus; XP_Bool iTrayHasFocus;
XP_Bool iAllFontsSame;
TRgb colors[COLOR_NCOLORS]; TRgb colors[COLOR_NCOLORS];
MPSLOT MPSLOT
@ -181,6 +182,14 @@ sym_draw_destroyCtxt( DrawCtx* p_dctx )
SymDrawCtxt* sctx = (SymDrawCtxt*)p_dctx; SymDrawCtxt* sctx = (SymDrawCtxt*)p_dctx;
XP_LOGF( "freeing draw ctxt" ); XP_LOGF( "freeing draw ctxt" );
CWsScreenDevice* sdev = sctx->iCoeEnv->ScreenDevice();
sdev->ReleaseFont( sctx->iTileFaceFont );
if ( ! sctx->iAllFontsSame ) {
sdev->ReleaseFont( sctx->iTileValueFont );
sdev->ReleaseFont( sctx->iBoardFont );
sdev->ReleaseFont( sctx->iScoreFont );
}
delete sctx->iRightArrow; delete sctx->iRightArrow;
delete sctx->iDownArrow; delete sctx->iDownArrow;
delete sctx->iStar; delete sctx->iStar;
@ -726,6 +735,7 @@ figureFonts( SymDrawCtxt* sctx )
sctx->iTileValueFont = sctx->iTileFaceFont; sctx->iTileValueFont = sctx->iTileFaceFont;
sctx->iBoardFont = sctx->iTileFaceFont; sctx->iBoardFont = sctx->iTileFaceFont;
sctx->iScoreFont = sctx->iTileFaceFont; sctx->iScoreFont = sctx->iTileFaceFont;
sctx->iAllFontsSame = XP_TRUE;
} }
#elif defined SERIES_60 #elif defined SERIES_60