diff --git a/.idea/orm.iml b/.idea/orm.iml index d4c62765..a10bc6d3 100644 --- a/.idea/orm.iml +++ b/.idea/orm.iml @@ -1,7 +1,11 @@ - + + + + + diff --git a/angel_orm/lib/src/pool.dart b/angel_orm/lib/src/pool.dart index 8d0f35f2..bc870bf5 100644 --- a/angel_orm/lib/src/pool.dart +++ b/angel_orm/lib/src/pool.dart @@ -37,7 +37,11 @@ class PostgreSQLConnectionPool { Future run(FutureOr callback(PostgreSQLConnection connection)) { return _pool.request().then((resx) { return _connect().then((connection) { - return new Future.sync(() => callback(connection)).whenComplete(resx.release); + return new Future.sync(() => callback(connection)) + .whenComplete(() async { + if (!connection.isClosed) await connection.close(); + resx.release(); + }); }); }); } diff --git a/angel_orm/pubspec.yaml b/angel_orm/pubspec.yaml index f1453319..a84ed6fc 100644 --- a/angel_orm/pubspec.yaml +++ b/angel_orm/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_orm -version: 1.0.0-alpha +version: 1.0.0-alpha+1 description: Runtime support for Angel's ORM. author: Tobe O homepage: https://github.com/angel-dart/orm