If emscripten/embind returns an object with a bunch of vector properties, do I need to call .delete() on each property, or can I just call .delete() on the returned object?
ie: If I am returned an emscripten ClassHandle for RGB, do I need to call rgb.r.delete(), or does rgb.delete() handle that for me?
#include <emscripten/bind.h>
using namespace emscripten;
class RGB {
public:
std::vector<unsigned char> r;
std::vector<unsigned char> g;
std::vector<unsigned char> b;
RGB (
std::vector<unsigned char> r_ = std::vector<unsigned char>(0,0),
std::vector<unsigned char> g_ = std::vector<unsigned char>(0,0),
std::vector<unsigned char> b_ = std::vector<unsigned char>(0,0)
) {
r = r_;
g = g_;
b = b_;
}
};
EMSCRIPTEN_BINDINGS(my_module) {
class_<RGB>("RGB")
.constructor<
std::vector<unsigned char>,
std::vector<unsigned char>,
std::vector<unsigned char>
>()
.property("r", &RGB::r)
.property("g", &RGB::g)
.property("b", &RGB::b)
;
register_vector<unsigned char>("Uint8Array");
}