Fixes a CGLayerRef leak.