# HG changeset patch # User Jan Vrany # Date 1483996482 0 # Node ID a59648e605938e9096786fb0c5e8c44fbbe905db # Parent 3e74422a72dd13ced2e72bc0dd36d3ccf12f192d XFT: Make destroying of an `XftDraw*` more robust ...expecially guard against double call to `XftDrawDestroy()` with the same `XftDraw*`. diff -r 3e74422a72dd -r a59648e60593 XGraphicsContext.st --- a/XGraphicsContext.st Fri Jan 06 23:53:36 2017 +0000 +++ b/XGraphicsContext.st Mon Jan 09 21:14:42 2017 +0000 @@ -30,7 +30,11 @@ destroy xftDrawId notNil ifTrue:[ - XftFontDescription xftDrawDestroy: xftDrawId + | id | + + id := xftDrawId. + xftDrawId := nil. + XftFontDescription xftDrawDestroy: id. ]. super destroy. diff -r 3e74422a72dd -r a59648e60593 XftFontDescription.st --- a/XftFontDescription.st Fri Jan 06 23:53:36 2017 +0000 +++ b/XftFontDescription.st Mon Jan 09 21:14:42 2017 +0000 @@ -307,8 +307,9 @@ xftDrawDestroy: xftDrawId %{ #ifdef XFT - if (__isExternalAddressLike(xftDrawId)) { - XftDraw *xftDraw = XFT_DRAW(xftDrawId); + XftDraw *xftDraw; + if (__isExternalAddressLike(xftDrawId) && (xftDraw = XFT_DRAW(xftDrawId)) != NULL) { + __externalAddressVal(xftDrawId) = NULL; XftDrawDestroy(xftDraw); } RETURN (self);