From a4672ba00ff03620bcbd9d43ee924cb6a81c79b4 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 11 Jul 2022 19:09:09 +0200 Subject: [PATCH] fix: remove unnecessary code for Windows Signed-off-by: Sefa Eyeoglu --- launcher/java/JavaUtils.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/launcher/java/JavaUtils.cpp b/launcher/java/JavaUtils.cpp index 5223256c..48add99e 100644 --- a/launcher/java/JavaUtils.cpp +++ b/launcher/java/JavaUtils.cpp @@ -204,12 +204,6 @@ QList JavaUtils::FindJavaFromRegistryKey(DWORD keyType, QString // This will be used to find any key that contains the JavaHome value. TCHAR *value = new TCHAR[0]; DWORD valueSz = 0; - if (RegQueryValueExW(jreKey, L"CurrentVersion", NULL, NULL, (BYTE *)value, &valueSz) == - ERROR_MORE_DATA) - { - value = new TCHAR[valueSz]; - RegQueryValueExW(jreKey, L"CurrentVersion", NULL, NULL, (BYTE *)value, &valueSz); - } TCHAR subKeyName[255]; DWORD subKeyNameSize, numSubKeys, retCode; @@ -237,6 +231,7 @@ QList JavaUtils::FindJavaFromRegistryKey(DWORD keyType, QString KEY_READ | KEY_WOW64_64KEY, &newKey) == ERROR_SUCCESS) { // Read the JavaHome value to find where Java is installed. + delete [] value; value = new TCHAR[0]; valueSz = 0; if (RegQueryValueExW(newKey, keyJavaDir.toStdWString().c_str(), NULL, NULL, (BYTE *)value,