未验证 提交 a8966c6e 编写于 作者: O openharmony_ci 提交者: Gitee

!9767 fix receiver Memory leak

Merge pull request !9767 from renhw001/master
...@@ -20,6 +20,8 @@ import { testPng } from "./testImg"; ...@@ -20,6 +20,8 @@ import { testPng } from "./testImg";
export default function addImage() { export default function addImage() {
describe("addImage", function () { describe("addImage", function () {
const RGBA_8888 = image.PixelMapFormat.RGBA_8888; const RGBA_8888 = image.PixelMapFormat.RGBA_8888;
let incSouce;
beforeAll(async function () { beforeAll(async function () {
console.info("beforeAll case"); console.info("beforeAll case");
}); });
...@@ -30,6 +32,13 @@ export default function addImage() { ...@@ -30,6 +32,13 @@ export default function addImage() {
afterEach(async function () { afterEach(async function () {
console.info("afterEach case"); console.info("afterEach case");
if (incSouce != undefined) {
try {
await incSouce.release();
} catch (error) {
console.info("incSouce release faile :"+error);
}
}
}); });
afterAll(async function () { afterAll(async function () {
...@@ -63,7 +72,6 @@ export default function addImage() { ...@@ -63,7 +72,6 @@ export default function addImage() {
async function createIncrementalSourcePromise(done, testNum, type, opts) { async function createIncrementalSourcePromise(done, testNum, type, opts) {
let testimagebuffer = testPng; let testimagebuffer = testPng;
let incSouce;
console.info(`${testNum} 0001 ` + testimagebuffer.length); console.info(`${testNum} 0001 ` + testimagebuffer.length);
let bufferSize = 5000; let bufferSize = 5000;
let offset = 0; let offset = 0;
...@@ -115,7 +123,6 @@ export default function addImage() { ...@@ -115,7 +123,6 @@ export default function addImage() {
async function createIncrementalSourceCb(done, testNum, type, opts) { async function createIncrementalSourceCb(done, testNum, type, opts) {
let testimagebuffer = testPng; let testimagebuffer = testPng;
let incSouce;
console.info(`${testNum} 0001 ` + testimagebuffer.length); console.info(`${testNum} 0001 ` + testimagebuffer.length);
let bufferSize = 5000; let bufferSize = 5000;
let offset = 0; let offset = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册