@livestore/wa-sqlite 1.0.3-dev.6 → 1.0.3-dev.7
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.
- package/package.json +1 -1
- package/src/sqlite-api.js +10 -3
package/package.json
CHANGED
package/src/sqlite-api.js
CHANGED
|
@@ -1048,12 +1048,19 @@ export function Factory(Module) {
|
|
|
1048
1048
|
const changesetOutPtr = Module.getValue(outPtrPtr, 'i32');
|
|
1049
1049
|
|
|
1050
1050
|
// Copy the inverted changeset data
|
|
1051
|
-
const changesetOut = new Uint8Array(Module.HEAPU8.buffer, changesetOutPtr, outLength);
|
|
1051
|
+
const changesetOut = new Uint8Array(Module.HEAPU8.buffer, changesetOutPtr, outLength).slice();
|
|
1052
1052
|
|
|
1053
1053
|
// Free allocated memory
|
|
1054
1054
|
Module._sqlite3_free(inPtr);
|
|
1055
|
-
|
|
1056
|
-
|
|
1055
|
+
|
|
1056
|
+
// TODO investigate why freeing these pointers causes a crash
|
|
1057
|
+
// RuntimeError: Out of bounds memory access (evaluating 'Module._sqlite3_free(outLengthPtr)')
|
|
1058
|
+
// Repro: https://gist.github.com/schickling/08b10b6fda8583601e586cb0bea333ce
|
|
1059
|
+
|
|
1060
|
+
// Module._sqlite3_free(outLengthPtr);
|
|
1061
|
+
// Module._sqlite3_free(outPtrPtr);
|
|
1062
|
+
|
|
1063
|
+
Module._sqlite3_free(changesetOutPtr);
|
|
1057
1064
|
|
|
1058
1065
|
return changesetOut;
|
|
1059
1066
|
};
|