mmomtchev / node-gdal-async

Node.js bindings for GDAL (Geospatial Data Abstraction Library) with full async support
https://mmomtchev.github.io/node-gdal-async/
Apache License 2.0
133 stars 26 forks source link

`gdal-async` should guarantee that all open Datasets are properly closed on process exit #25

Closed mmomtchev closed 2 years ago

mmomtchev commented 2 years ago

V8 has a reputation for skipping unneeded object destruction on process exit and this script can sometimes produce a corrupted file:

const gdal = require('gdal-async');

gdal.open('tmp.tiff', 'w', 'GTiff', 100, 100, 1, gdal.GDT_Float64);

gdal-async documentation makes it clear that this should not be allowed to happen