From 7dc9fd05132358e5dafb9e6864f0c60cbf6a653d Mon Sep 17 00:00:00 2001 From: xiaohaichun Date: Wed, 19 Sep 2018 21:10:46 +0800 Subject: [PATCH] fix bug --- metal/paddle-mobile/paddle-mobile/Net.swift | 2 +- metal/paddle-mobile/paddle-mobile/PaddleMobileGPU.m | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/metal/paddle-mobile/paddle-mobile/Net.swift b/metal/paddle-mobile/paddle-mobile/Net.swift index 1c90d04fe6..ce9ec98a66 100644 --- a/metal/paddle-mobile/paddle-mobile/Net.swift +++ b/metal/paddle-mobile/paddle-mobile/Net.swift @@ -24,7 +24,7 @@ public class ResultHolder: NSObject { capacity = inCapacity } - public func releasePointer() { + @objc public func releasePointer() { result?.deinitialize(count: capacity) result?.deallocate() } diff --git a/metal/paddle-mobile/paddle-mobile/PaddleMobileGPU.m b/metal/paddle-mobile/paddle-mobile/PaddleMobileGPU.m index cb989123bb..48f39d0b1b 100644 --- a/metal/paddle-mobile/paddle-mobile/PaddleMobileGPU.m +++ b/metal/paddle-mobile/paddle-mobile/PaddleMobileGPU.m @@ -49,6 +49,7 @@ [resultArray addObject:[NSNumber numberWithFloat:result.result[i]]]; } completion(success, resultArray); + [result releasePointer]; }]; // [runner predictWithTexture:texture completion:completion]; -- GitLab