Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.

Commit 8d125ee

Browse files
committed
disable the ObjC proxy.
1. we want to be able to subscribe the same `self` object to be subscrube to two different `subscribe:` methods 2. perf improvement
1 parent 1d888ae commit 8d125ee

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

support-lib/objc/DJIObjcWrapperCache+Private.h

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,27 @@ extern template class ProxyCache<ObjcProxyCacheTraits>;
4040
using ObjcProxyCache = ProxyCache<ObjcProxyCacheTraits>;
4141

4242
template <typename CppType, typename ObjcType>
43-
static std::shared_ptr<CppType> get_objc_proxy(ObjcType * objcRef) {
44-
return std::static_pointer_cast<CppType>(ObjcProxyCache::get(
45-
objcRef,
46-
[] (const __strong id & objcRef) -> std::pair<std::shared_ptr<void>, __unsafe_unretained id> {
47-
return {
48-
std::make_shared<CppType>(objcRef),
49-
objcRef
50-
};
51-
}
52-
));
43+
static std::shared_ptr<CppType> get_objc_proxy(ObjcType * objcRef)
44+
{
45+
return std::make_shared<CppType>(objcRef);
46+
47+
// HAIMG: we do not use this, as we want to be able to `subscribe:` the same ObjC to two different `subscribe:` methods like in LSVmBotList and LSVmUserList
48+
49+
// return std::static_pointer_cast<CppType>(ObjcProxyCache::get(
50+
// objcRef,
51+
// [] (const __strong id & objcRef) -> std::pair<std::shared_ptr<void>, __unsafe_unretained id> {
52+
// return {
53+
// std::make_shared<CppType>(objcRef),
54+
// objcRef
55+
// };
56+
// }
57+
// ));
5358
}
5459

5560
} // namespace djinni
61+
62+
63+
64+
65+
66+

0 commit comments

Comments
 (0)