Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
81c723ed
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
81c723ed
编写于
2月 28, 2011
作者:
P
prr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7004728: [parfait] potential memory leaks in XRender code
Reviewed-by: bae, ceisserer
上级
6aa5eea8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
68 addition
and
25 deletion
+68
-25
src/solaris/native/sun/java2d/x11/XRBackendNative.c
src/solaris/native/sun/java2d/x11/XRBackendNative.c
+68
-25
未找到文件。
src/solaris/native/sun/java2d/x11/XRBackendNative.c
浏览文件 @
81c723ed
...
...
@@ -304,23 +304,27 @@ Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative
color
.
blue
=
blue
;
if
(
rectCnt
<=
256
)
{
xRects
=
&
sRects
[
0
];
xRects
=
&
sRects
[
0
];
}
else
{
xRects
=
(
XRectangle
*
)
malloc
(
sizeof
(
XRectangle
)
*
rectCnt
);
if
(
xRects
==
NULL
)
{
return
;
}
xRects
=
(
XRectangle
*
)
malloc
(
sizeof
(
XRectangle
)
*
rectCnt
);
if
(
xRects
==
NULL
)
{
return
;
}
}
if
((
rects
=
(
jint
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
rectArray
,
NULL
))
==
NULL
)
{
return
;
if
((
rects
=
(
jint
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
rectArray
,
NULL
))
==
NULL
)
{
if
(
xRects
!=
&
sRects
[
0
])
{
free
(
xRects
);
}
return
;
}
for
(
i
=
0
;
i
<
rectCnt
;
i
++
)
{
xRects
[
i
].
x
=
rects
[
i
*
4
+
0
];
xRects
[
i
].
y
=
rects
[
i
*
4
+
1
];
xRects
[
i
].
width
=
rects
[
i
*
4
+
2
];
xRects
[
i
].
height
=
rects
[
i
*
4
+
3
];
xRects
[
i
].
x
=
rects
[
i
*
4
+
0
];
xRects
[
i
].
y
=
rects
[
i
*
4
+
1
];
xRects
[
i
].
width
=
rects
[
i
*
4
+
2
];
xRects
[
i
].
height
=
rects
[
i
*
4
+
3
];
}
XRenderFillRectangles
(
awt_display
,
op
,
...
...
@@ -328,7 +332,7 @@ Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
rectArray
,
rects
,
JNI_ABORT
);
if
(
xRects
!=
&
sRects
[
0
])
{
free
(
xRects
);
free
(
xRects
);
}
}
...
...
@@ -610,17 +614,30 @@ Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative
Glyph
*
gid
=
(
Glyph
*
)
malloc
(
sizeof
(
Glyph
)
*
glyphCnt
);
if
(
xginfo
==
NULL
||
gid
==
NULL
)
{
return
;
if
(
xginfo
!=
NULL
)
{
free
(
xginfo
);
}
if
(
gid
!=
NULL
)
{
free
(
gid
);
}
return
;
}
if
((
glyphInfoPtrs
=
(
jlong
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
glyphInfoPtrsArray
,
NULL
))
==
NULL
)
{
if
((
glyphInfoPtrs
=
(
jlong
*
)(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
glyphInfoPtrsArray
,
NULL
))
==
NULL
)
{
free
(
xginfo
);
free
(
gid
);
return
;
}
if
((
pixelData
=
(
unsigned
char
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
pixelDataArray
,
NULL
))
==
NULL
)
{
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
pixelDataArray
,
NULL
))
==
NULL
)
{
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
glyphInfoPtrsArray
,
glyphInfoPtrs
,
JNI_ABORT
);
glyphInfoPtrsArray
,
glyphInfoPtrs
,
JNI_ABORT
);
free
(
xginfo
);
free
(
gid
);
return
;
}
...
...
@@ -637,7 +654,7 @@ Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative
}
XRenderAddGlyphs
(
awt_display
,
glyphSet
,
&
gid
[
0
],
&
xginfo
[
0
],
glyphCnt
,
pixelData
,
pixelDataLength
);
(
const
char
*
)
pixelData
,
pixelDataLength
);
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
glyphInfoPtrsArray
,
glyphInfoPtrs
,
JNI_ABORT
);
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
pixelDataArray
,
pixelData
,
JNI_ABORT
);
...
...
@@ -684,22 +701,44 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
xelts
=
&
selts
[
0
];
}
else
{
xelts
=
(
XGlyphElt32
*
)
malloc
(
sizeof
(
XGlyphElt32
)
*
eltCnt
);
if
(
xelts
==
NULL
)
{
return
;
}
}
if
(
glyphCnt
<=
256
)
{
xids
=
&
sids
[
0
];
}
else
{
}
else
{
xids
=
(
Glyph
*
)
malloc
(
sizeof
(
Glyph
)
*
glyphCnt
);
if
(
xids
==
NULL
)
{
if
(
xelts
!=
&
selts
[
0
])
{
free
(
xelts
);
}
return
;
}
}
if
((
ids
=
(
jint
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
glyphIDArray
,
NULL
))
==
NULL
)
{
return
;
if
((
ids
=
(
jint
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
glyphIDArray
,
NULL
))
==
NULL
)
{
if
(
xelts
!=
&
selts
[
0
])
{
free
(
xelts
);
}
if
(
xids
!=
&
sids
[
0
])
{
free
(
xids
);
}
return
;
}
if
((
elts
=
(
jint
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
eltArray
,
NULL
))
==
NULL
)
{
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
glyphIDArray
,
ids
,
JNI_ABORT
);
return
;
if
(
xelts
!=
&
selts
[
0
])
{
free
(
xelts
);
}
if
(
xids
!=
&
sids
[
0
])
{
free
(
xids
);
}
return
;
}
for
(
i
=
0
;
i
<
glyphCnt
;
i
++
)
{
...
...
@@ -724,11 +763,11 @@ Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
(
*
env
)
->
ReleasePrimitiveArrayCritical
(
env
,
eltArray
,
elts
,
JNI_ABORT
);
if
(
xelts
!=
&
selts
[
0
])
{
free
(
xelts
);
free
(
xelts
);
}
if
(
xids
!=
&
sids
[
0
])
{
free
(
xids
);
free
(
xids
);
}
}
...
...
@@ -762,8 +801,12 @@ Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative
}
}
if
((
rects
=
(
jint
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
rectArray
,
NULL
))
==
NULL
)
{
return
;
if
((
rects
=
(
jint
*
)
(
*
env
)
->
GetPrimitiveArrayCritical
(
env
,
rectArray
,
NULL
))
==
NULL
)
{
if
(
xRects
!=
&
sRects
[
0
])
{
free
(
xRects
);
}
return
;
}
for
(
i
=
0
;
i
<
rectCnt
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录