perliedman / ocad2geojson

JavaScript OCAD file reader and exporter for GeoJSON, SVG and Mapbox Style Spec
https://www.liedman.net/ocad2geojson/
GNU Affero General Public License v3.0
39 stars 4 forks source link

File reader keeps reference to original file buffer #10

Closed perliedman closed 3 years ago

perliedman commented 4 years ago

The file reader is built with a lot of classes all extending Block, which made it easy to implement the reader, but as a side effect makes every such class keep a reference to the original OCAD files Buffer object.

This makes us hold on to a lot of memory that we no longer need - all information has already been extracted while reading the file and constructing the objects.

Reading should be better separated from the data objects that hold the read data, so that the buffer can be freed once the file has been completely read.

perliedman commented 3 years ago

Fixed by 966b38bf45f0e675f75821a6e7c56368b44987dc :tada: