Index: lib/typedObjects/objectTypes.js |
diff --git a/lib/typedObjects/objectTypes.js b/lib/typedObjects/objectTypes.js |
index 4fa97d40e33681a8a60b05b9b4d26c898907d3ea..e7b5d9aa43c44922af7337a0d3e4135359ebe50c 100644 |
--- a/lib/typedObjects/objectTypes.js |
+++ b/lib/typedObjects/objectTypes.js |
@@ -81,10 +81,17 @@ function free(obj) |
} |
finally |
{ |
- for (let [prop, value] of this.initialValues) |
- obj[prop] = value; |
+ if (obj._copy) |
+ { |
+ Object.getPrototypeOf(obj).release(); |
+ } |
+ else |
+ { |
+ for (let [prop, value] of this.initialValues) |
+ obj[prop] = value; |
- dealloc(this.firstFree, obj.bufferIndex, obj.byteOffset); |
+ dealloc(this.firstFree, obj.bufferIndex, obj.byteOffset); |
+ } |
} |
} |