8179533: Cleaner print job handling
authorprr
Wed, 17 May 2017 14:52:09 -0700
changeset 48561 f6796a7e4454
parent 48560 46e99460e8c9
child 48562 592c141b1ca3
8179533: Cleaner print job handling Reviewed-by: serb, mschoene, rhalade
src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp
--- a/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Fri Apr 28 10:17:46 2017 -0400
+++ b/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp	Wed May 17 14:52:09 2017 -0700
@@ -508,14 +508,14 @@
           names = env->NewObjectArray(cReturned, cls, NULL);
       }
       if (names == NULL || cls == NULL) {
-          delete buf;
+          delete[] buf;
           return names;
       }
 
       for (int i = 0; i < cReturned; i++) {
           utf_str = JNU_NewStringPlatform(env, buf+(buf_len*i));
             if (utf_str == NULL) {
-                delete buf;
+                delete[] buf;
                 return names;
             }
             env->SetObjectArrayElement(names, i, utf_str);