瀏覽代碼

HPCC-10460 Streamed dataset support for Java

Fix memory leak of incoming Roxie rows

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 年之前
父節點
當前提交
78b341d5ea
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 1 0
      plugins/javaembed/CMakeLists.txt
  2. 3 2
      plugins/javaembed/javaembed.cpp

+ 1 - 0
plugins/javaembed/CMakeLists.txt

@@ -72,6 +72,7 @@ if (USE_JNI)
     #    ${JSIG_LIBRARY}
         ${JAVA_JVM_LIBRARY}
         eclrtl
+        roxiemem
         jlib
         )
   endif()

+ 3 - 2
plugins/javaembed/javaembed.cpp

@@ -2113,10 +2113,11 @@ public:
             JavaObjectBuilder javaBuilder(sharedCtx->JNIenv, &dummyField, className);
             for (;;)
             {
-                const byte *thisRow = (const byte *) val->ungroupedNextRow();
+                roxiemem::OwnedConstRoxieRow thisRow = val->ungroupedNextRow();
                 if (!thisRow)
                     break;
-                typeInfo->process(thisRow, thisRow, &dummyField, javaBuilder); // Creates a java object from the incoming ECL row
+                const byte *brow = (const byte *) thisRow.get();
+                typeInfo->process(brow, brow, &dummyField, javaBuilder); // Creates a java object from the incoming ECL row
                 allRows.append(javaBuilder.getObject());
             }
             jobjectArray array = sharedCtx->JNIenv->NewObjectArray(allRows.length(), sharedCtx->JNIenv->FindClass(className), NULL);