aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-v-helper.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-10 15:41:47 +0000
committerstephan <stephan@noemail.net>2022-12-10 15:41:47 +0000
commit8c0041f5bfc351623bc509825282063d4369cd13 (patch)
tree4763e8668ac09945616f38ef8bb3041d6a200fae /ext/wasm/api/sqlite3-v-helper.js
parent9cb6ff27923b340c06d8bae1b8a6130a3e5b8571 (diff)
downloadsqlite-8c0041f5bfc351623bc509825282063d4369cd13.tar.gz
sqlite-8c0041f5bfc351623bc509825282063d4369cd13.zip
Remove two incorrect calls to structType.dipose() which prematurely freed objects in use by the virtual table test/demo code.
FossilOrigin-Name: 060eb2848975a24ff6683a8a9c4d7546ae36147323b0edae01fb42f52d9bb2d6
Diffstat (limited to 'ext/wasm/api/sqlite3-v-helper.js')
-rw-r--r--ext/wasm/api/sqlite3-v-helper.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/ext/wasm/api/sqlite3-v-helper.js b/ext/wasm/api/sqlite3-v-helper.js
index ab296172f..10be8ebce 100644
--- a/ext/wasm/api/sqlite3-v-helper.js
+++ b/ext/wasm/api/sqlite3-v-helper.js
@@ -320,16 +320,6 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
};
/**
- Expects to be passed the (argc,argv) arguments of
- sqlite3_module::xFilter(), or an equivalent API. This function
- transforms the arguments (an array of (sqlite3_value*)) into a JS
- array of equivalent JS values. It uses the same type conversions
- as sqlite3_create_function_v2() and friends. Throws on error,
- e.g. if it cannot figure out a sensible data conversion.
- */
- vtab.sqlite3ValuesToJs = capi.sqlite3_create_function_v2.udfConvertArgs;
-
- /**
Internal factory function for xVtab and xCursor impls.
*/
const __xWrapFactory = function(methodName,StructType){
@@ -401,6 +391,9 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
sqlite3_vtab_cursor: to be called from any sqlite3_module methods
which take a `sqlite3_vtab_cursor*` argument except xClose(),
in which case use unget() or dispose().
+
+ Rule to remember: _never_ call dispose() on an instance
+ returned by this function.
*/
get: (pCObj)=>__xWrap(pCObj),
/**
@@ -416,6 +409,9 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
sqlite3_vtab_cursor: to be called from xClose() or during
cleanup in a failed xOpen().
+
+ Calling this method obligates the caller to call dispose() on
+ the returned object when they're done with it.
*/
unget: (pCObj)=>__xWrap(pCObj,true),
/**