From 30d9e9d6dc71b3352aae3ec72a33d11c2bd6bb4a Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Fri, 15 Apr 2011 16:51:25 +0400 Subject: [PATCH] 6983562: Two java/awt tests failing just on jdk7b108 Reviewed-by: art, denis, dcherepanov --- jdk/src/windows/native/sun/windows/awt_Button.cpp | 4 +++- jdk/src/windows/native/sun/windows/awt_Checkbox.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jdk/src/windows/native/sun/windows/awt_Button.cpp b/jdk/src/windows/native/sun/windows/awt_Button.cpp index b62069035c1..672d3540c1d 100644 --- a/jdk/src/windows/native/sun/windows/awt_Button.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Button.cpp @@ -317,7 +317,9 @@ void AwtButton::_SetLabel(void *param) badAlloc = 1; } else { c->SetText(labelStr); - JNU_ReleaseStringPlatformChars(env, label, labelStr); + if (label != NULL) { + JNU_ReleaseStringPlatformChars(env, label, labelStr); + } } } diff --git a/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp b/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp index 21f42bea3dd..362c857b88d 100644 --- a/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Checkbox.cpp @@ -384,7 +384,9 @@ void AwtCheckbox::_SetLabel(void *param) { c->SetText(labelStr); c->VerifyState(); - JNU_ReleaseStringPlatformChars(env, label, labelStr); + if (label != NULL) { + JNU_ReleaseStringPlatformChars(env, label, labelStr); + } } }