Merge branch 'master' of github.com:mojaveazure/loomR
[loomr.git] / R / loom.R
index b24b70a479e9fa6d4e43bceb7bd31d357a9250c7..8b31f8bafabbe71d9e9718b3761237f116b85921 100644 (file)
--- a/R/loom.R
+++ b/R/loom.R
@@ -128,6 +128,9 @@ loom <- R6Class(
         self$version <- as.character(x = packageVersion(pkg = 'loomR'))
       }
     },
+    finalizer = function() {
+      self$close_all(close_self = TRUE)
+    }
     # Addding attributes and layers
     add.layer = function(layers, overwrite = FALSE) {
       if (self$mode == 'r') {