6728838: Native memory leak in StrikeCache.java

Reviewed-by: bae, igor
This commit is contained in:
Phil Race 2008-12-24 09:53:52 -08:00
parent 5b1de891b3
commit fa5248c9db

View File

@ -232,6 +232,16 @@ public final class StrikeCache {
if (disposer.pScalerContext != 0L) {
freeLongMemory(new long[0], disposer.pScalerContext);
}
} else if (disposer.pScalerContext != 0L) {
/* Rarely a strike may have been created that never cached
* any glyphs. In this case we still want to free the scaler
* context.
*/
if (FontManager.longAddresses) {
freeLongMemory(new long[0], disposer.pScalerContext);
} else {
freeIntMemory(new int[0], disposer.pScalerContext);
}
}
}