-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2fcs
-
x86
-
windows_nt
-
Not verified
There was an earlier workaround in awt/2D causes significant memory leakage during the test. See line 306 in win32/native/sun/windows/awt_Graphics.cpp
void AwtGraphics::SetJavaObject(JNIEnv *env, jobject obj)
{
if (obj == NULL && m_javaObject != NULL) {
/* we are disposing of this, and need to clean up m_javaObject */
env->SetIntField(m_javaObject, AwtGraphics::pDataID, 0);
// env->DeleteWeakGlobalRef(m_javaObject);
/****** The above line cause memory leakage. ******/
} else if (obj != NULL) {
/* we are setting m_javaObject */
ASSERT(JNU_IsInstanceOfByName(env, obj,
"sun/awt/windows/WGraphics") > 0);
m_javaObject = env->NewWeakGlobalRef(obj);
}
}
void AwtGraphics::SetJavaObject(JNIEnv *env, jobject obj)
{
if (obj == NULL && m_javaObject != NULL) {
/* we are disposing of this, and need to clean up m_javaObject */
env->SetIntField(m_javaObject, AwtGraphics::pDataID, 0);
// env->DeleteWeakGlobalRef(m_javaObject);
/****** The above line cause memory leakage. ******/
} else if (obj != NULL) {
/* we are setting m_javaObject */
ASSERT(JNU_IsInstanceOfByName(env, obj,
"sun/awt/windows/WGraphics") > 0);
m_javaObject = env->NewWeakGlobalRef(obj);
}
}