dynamsoft-capture-vision-react-native 2.6.1013 → 2.6.1014

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,6 +46,17 @@ Value ImageDataHostObject::get(Runtime &runtime, const PropNameID &propName) {
46
46
  memcpy(destinationBuffer, buffer, sizeof(uint8_t) * bufferSize);
47
47
  return arrayBuffer;
48
48
  }
49
+ if (name == "release") {
50
+ auto release = [=](Runtime & runtime, const Value& thisValue, const Value* arguments, size_t count) -> Value {
51
+ if(buffer != nullptr) {
52
+ delete[] buffer;
53
+ buffer = nullptr;
54
+ bufferSize = 0;
55
+ }
56
+ return {};
57
+ };
58
+ return Function::createFromHostFunction(runtime, PropNameID::forUtf8(runtime, "release"), 0, release);
59
+ }
49
60
  return {};
50
61
  }
51
62
 
@@ -71,5 +82,6 @@ std::vector<PropNameID> ImageDataHostObject::getPropertyNames(Runtime &rt) {
71
82
  result.push_back(PropNameID::forUtf8(rt, std::string("format")));
72
83
  result.push_back(PropNameID::forUtf8(rt, std::string("orientation")));
73
84
  result.push_back(PropNameID::forUtf8(rt, std::string("buffer")));
85
+ result.push_back(PropNameID::forUtf8(rt, std::string("release")));
74
86
  return result;
75
87
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dynamsoft-capture-vision-react-native",
3
3
  "title": "Dynamsoft Capture Vision React Native",
4
- "version": "2.6.1013",
4
+ "version": "2.6.1014",
5
5
  "description": "Dynamsoft Capture Vision React Native SDK. The SDK supports barcode decoding, document scanning and MRZ reading.",
6
6
  "homepage": "https://github.com/Dynamsoft/capture-vision-react-native-samples",
7
7
  "main": "src/index.tsx",