Hi,
I have a problem with smart-pointer. When i pass it for a JS function, the PTR is undefined and COUNT is undefined.
https://user-images.githubusercontent.com/395096/211975635-50b02139-b9ea-4130-995d-dcbf3ea1da44.pngThe class that receive the smart-ptr is OK, but the method that receive a smart-ptr is wrong.
The bind code is:
```
EMSCRIPTEN_BINDINGS(xplpc_proxy_platform_proxy_callback)
{
em::class_<xplpc::proxy::PlatformProxyCallback>("PlatformProxyCallback")
.constructor<const std::function<void(const std::string &)> &&>()
.smart_ptr<std::shared_ptr<xplpc::proxy::PlatformProxyCallback>>("shared_ptr<PlatformProxyCallback>")
.function("call", &xplpc::proxy::PlatformProxyCallback::call);
}
```File:
https://github.com/xplpc/xplpc/blob/wasm-mapping/wasm/lib/src/bind.cpp#L33-L39The javascript function is:
```
onRemoteProxyCallAsync: function (data: string, callback: XWebPlatformProxyCallback) {
console.log("[XWebPlatformProxy : onRemoteProxyCallAsync] This: ", this);
console.log("[XWebPlatformProxy : onRemoteProxyCallAsync] Callback: ", callback);
}
```File:
https://github.com/xplpc/xplpc/blob/wasm-mapping/wasm/sample/src/xplpc/proxy/platform-proxy.ts#L31-L33The C++ code that call the JS function is:
```
void callProxyAsync(const std::string &data, std::shared_ptr<xplpc::proxy::PlatformProxyCallback> callback)
{
// the count is 2
spdlog::info("[callProxyAsync 1] Callback Smart Ptr Count: {}", callback.use_count());
call<void>("onRemoteProxyCallAsync", data, callback);
spdlog::info("[callProxyAsync 2]");
}
```What im doing wrong? Thanks.